I'm working on a VB6 graphical interface that make use of a DLL generated from a C code that makes use of __declspec(thread)
variables. The problem is that because of a known limitation, it is not possible to dynamically link this dll in the VB6 project.
So, as suggested in this discussion, a possible solution is to create an IDL file from the DLL, compile it with a MIDL compiler, and then reference the resulting .tlb file in the VB6 project.
I'm able to generate the .tlb file until I have to specify functions that contain struct variables
[
uuid(YOURTYPE-LIBG-UIDH-ERE0-000000000000),
version(1.0),
helpstring ("My Type Library 1.0")
]
libra开发者_运维百科ry MyTypeLib
{
importlib("stdole2.tlb");
[dllname("OLEAUT32")]
module OleAut32
{
[entry("myFunct")]
int myFunct([in] myStruct data);
};
};
At the row: int myFunct([in] myStruct data);
the compiler says:
syntax error: expecting a type specification near "myStruct"
Is there a way to make it works? Like some kind of struct declaration in the IDL file?
Thank you,
G.B.
SOLVED here by wqw. Thanks
精彩评论