开发者

Creating an IDL file from a DLL [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 11 years ago.

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜