如何使用IDispatch的纯C语言调用COM对象 [英] How to use IDispatch in plain C to call a COM object
问题描述
我需要使用包含在R工具gcc编译器(R窗户统计程序)编译我的一些code,问题是我需要使用的IDispatch在我的code创建访问COM对象的方法和GCC编译器不支持大部分的code,我使用这样做的,这基本上是C ++ code的。
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.
所以我的问题是如何使用的IDispatch用C,而不必依赖于MFC,.NET,C#,WTL,或ATL创建COM对象。我相信,如果我这样做,我将能够编译我的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.
推荐答案
有题为COM纯C上$ C $的CProject一个伟大的文章。
There is a great article on CodeProject entitled "COM in plain C".
下面是链接第1部分。
有是该文章中与COM工作在C很多非常好的信息和作者的后续跟进(我认为有3或4系列)。
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).
编辑:
我错了,有8份!
I was wrong, there are 8 parts!
第2部分
第3部分
第4部分
第5
第6部分
部分7
第8部分
这篇关于如何使用IDispatch的纯C语言调用COM对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!