|
-
Dec 21st, 2021, 04:47 PM
#5
New Member
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
 Originally Posted by fafalone
I got the paths problems fixed but the big issue now is the MIDL2003 redefinition problem. It gives that error whenever you define something that's already defined in Windows. Which is everything. If anyone has dealt with this before, let me know.
Edit: What changes to the code itself would need to be made (what is the problem encountered when trying to use it in 64bit Office), assuming I can overcome the redefinition issue which might not be possible as every solution I've encountered says it's by design and to rename things.
"oleexp.tlb" is very useful but not compatible with 64 Excel VBA.
As you know, Handle and Pointer (memory address) have 8 bytes of data in 64-bit processes. Therefore, this TLB must be recompiled as 64-bit.
E.g; User32.FindWindow function, which is one of the frequently used functions, throws an overflow exception because it returns a 64-bit number when using the existing 32-bit oleexp.tlb.
As another example; The IDispatch.GetTypeInfo.AddressOfMember function must return a 64-bit integer.
Since some structures and functions in TLB take the data type as ByRef, we cannot send type conversion functions such as CLngPtr.
For these reasons 64-bit compilation is required.
As a solution, if you describe how you overcome the "redefined" and "same uuid" errors that are printed on the screen when compiling the IDL content I have given as an example below with MIDL.EXE, everyone, especially me, can compile the interfaces they need.
Simple IDL:
Code:
[
uuid(035AE7E1-92D3-47F9-BACA-E9DF8FD28333),
version(1.0),
helpstring("Test type library")
]
library test
{
importlib("stdole2.tlb");
interface IUnknown;
typedef struct UUID {
LONG Data1;
SHORT Data2;
SHORT Data3;
BYTE Data4[8];
} UUID;
[
odl,
uuid(00000000-0000-0000-C000-000000000046)
]
interface IUnknown {
LONG QueryInterface(
[in, out] UUID *riid,
[in, out] void *ppvObject);
LONG AddRef();
LONG Release();
};
};
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|