How do I reference and communciate with an ActiveX library from within my gcc compiled application?
如何从我的gcc编译应用程序中引用和与ActiveX库通信?
1 个解决方案
#1
Well, I've never actually tried it, but there is no reason you wouldn't be able to do this. You basically just need to have the interface definitions for the classes you need (might be able to get this from VS) and then make the appropriate calls.
好吧,我从来没有真正尝试过,但没有理由你不能这样做。您基本上只需要拥有所需类的接口定义(可能能够从VS获取)然后进行适当的调用。
The function CoCreateInstance is in Ole32.dll, so you could probably load the library, get the entrypoint, and then you just have to find the CLSIDs for creating the COM object you want, etc. As long as you are careful about only casting with QueryInterface, you should be just fine; COM was designed specifically to provide binary compatibility so that this would be possible.
函数CoCreateInstance在Ole32.dll中,所以你可以加载库,获取入口点,然后你只需要找到用于创建所需COM对象的CLSID等等。只要你注意只使用QueryInterface,你应该没问题; COM专门设计用于提供二进制兼容性,以便实现这一点。
http://msdn.microsoft.com/en-us/library/ms686615%28VS.85%29.aspx
the hardest part will be getting all the headers and such that you need.
最困难的部分是获得所有标题,以及您需要的。
#1
Well, I've never actually tried it, but there is no reason you wouldn't be able to do this. You basically just need to have the interface definitions for the classes you need (might be able to get this from VS) and then make the appropriate calls.
好吧,我从来没有真正尝试过,但没有理由你不能这样做。您基本上只需要拥有所需类的接口定义(可能能够从VS获取)然后进行适当的调用。
The function CoCreateInstance is in Ole32.dll, so you could probably load the library, get the entrypoint, and then you just have to find the CLSIDs for creating the COM object you want, etc. As long as you are careful about only casting with QueryInterface, you should be just fine; COM was designed specifically to provide binary compatibility so that this would be possible.
函数CoCreateInstance在Ole32.dll中,所以你可以加载库,获取入口点,然后你只需要找到用于创建所需COM对象的CLSID等等。只要你注意只使用QueryInterface,你应该没问题; COM专门设计用于提供二进制兼容性,以便实现这一点。
http://msdn.microsoft.com/en-us/library/ms686615%28VS.85%29.aspx
the hardest part will be getting all the headers and such that you need.
最困难的部分是获得所有标题,以及您需要的。