我正在使用一个VB6graphics界面,它使用从C代码生成的DLL,它使用__declspec(thread)
variables。 问题是,由于已知的限制 ,不能dynamic链接VB6项目中的这个DLL。
因此,正如在这个讨论中所build议的,一个可能的解决scheme是从DLL中创build一个IDL文件,用一个MIDL编译器编译它,然后在VB6项目中引用生成的.tlb文件。
我能够生成.tlb文件,直到我必须指定包含结构variables的函数
[ uuid(YOURTYPE-LIBG-UIDH-ERE0-000000000000), version(1.0), helpstring ("My Type Library 1.0") ] library MyTypeLib { importlib("stdole2.tlb"); [dllname("OLEAUT32")] module OleAut32 { [entry("myFunct")] int myFunct([in] myStruct data); }; };
在行: int myFunct([in] myStruct data);
编译器说:
syntax error: expecting a type specification near "myStruct"
有没有办法让它工作? 像IDL文件中的某种结构声明?
谢谢,
GB
在这里由wqw解决。 谢谢