如何使用IDispatch在纯C中调用一个COM对象 [英] How to use IDispatch in plain C to call a COM object
问题描述
我需要编译一些我的代码使用gcc编译器包含在R工具(R的统计程序为Windows),问题是,我需要使用IDispatch在我的代码创建访问的方法的COM对象,gcc编译器不支持我使用的大部分代码,这基本上是C ++代码。
所以我的问题是如何我在C中使用IDispatch来创建COM对象,而不必依赖于MFC,.NET,C#,WTL或ATL。我相信,如果我这样做,我将能够编译我的代码没有任何问题。
有一篇关于CodeProject的文章,名为COM in plain C。
这里是第1部分的链接。
在这篇文章中,有很多关于使用C的COM的很好的信息和作者的后续跟进(我认为系列中有3或4个)。
编辑:
我错了,共有8个部分!
第2部分
第3部分
第4部分
第5部分
第6部分
部分7
第8部分
I need to compile some code of mine using the gcc compiler included in the R tools (R the statistical program for windows), the problem is that I need to use IDispatch in my code to create an access the methods of a COM object, and the gcc compiler doesn't support much of the code that I'm using to do so, which is basically C++ code.
So my question is how can I use IDispatch in C to create the COM object without having to depend on MFC, .NET, C#, WTL, or ATL. I believe that if I do so I will be able to compile my code without any problem.
There is a great article on CodeProject entitled "COM in plain C".
Here is the link to Part 1.
There is a lot of very good info on working with COM in C in that article and the author's subsequent follow-ups (I think there are 3 or 4 in the series).
Edit:
I was wrong, there are 8 parts!
Part 2
Part 3
Part 4
Part 5
Part 6
Part 7
Part 8
这篇关于如何使用IDispatch在纯C中调用一个COM对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!