#import "c:\\test\\test.dll"//假定你的com是在test.dll中实现的
解决方案 »
- Event可以完全代替Mutex吗?
- 大家知道有哪些开源的图像处理库啊?
- 不知道网址秀(www.wzxiu.com)是怎么在windows2000的右键菜单中增加菜单项的?
- 无边框对话框如何拖动改变大小?
- 怎样拷贝、删除指定的文件?
- 我在MFC中添加了一个.cpp文件,里面有一个线程,可在对话框上的按钮的响应事件中AfxBeginThread报错
- 对不起,我哭了
- 想请教大家最小化一个对话框的API函数是什么
- 我从一个类中弹出一个对话框类,现在,想从对话框类中操作原有的类,该怎么做???
- 请问一个.c和两个.cpp文件能互相调用
- 请问:*.ace格式的压缩文件用什么工具打开?
- 十万火急,关于CRichEditView的SetFont的问题
在它们的类中CInterface1要引用接口IInterface2,可能用下面的方式:
IInterface2Ptr pInt;
我的两个类都在同一个DLL中,我怎么IMPORT自已?
CComObject<CGoo>* pGoo;
// Note that at this point the ref count for the object is 0.
HRESULT hRes = CComObject< CGoo >::CreateInstance(&pGoo);//smart pointer for IGoo
IGooPtr spGoo;
pGoo->QueryInterface(IID_IGoo, (void**) &spGoo);
// use spGoo now, refcount is 1...We're using the ATL object template class here, and calling the ATL static method CreateInstance to create the object. This is the function that would otherwise be called by the class factory—so this is the right way to create objects without using a class factory.After we create the object, we call QueryInterface using the ATL smart pointer but pass the COM smart pointer. At this point, we use the object through spGoo so we can take advantage of the helper functions to access properties.