在VC.NET里怎么调用一个封装在DLL里的COM组件啊,谢谢!!!急问!!!!! 在VC.NET里怎么调用一个封装在DLL里的COM组件啊,谢谢!!!我只有一个DLL,还知道他的几个方法,别的都不知道了,不太懂应该怎么操作,谢谢!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 没有头文件?DLL注册了没有,如果注册了,而且Com组件是自动化的,那么只要知道里面的方法,参数等。没有头文件也可以,使用IDispatch接口调用就可以了。 对.NET项目->添加引用->浏览->打开DLL的COM组件ok to steedhorse: dll注册过了,没有头文件,用IDispatch接口怎么调用?能给一点示例代码么?我刚刚接触COM,对一些接口的概念有的模糊,请大家多多指教,谢谢!to uno: 用引用没有用,在C#项目里面有用能看到接口,在VC++项目里面就看不到,不知道为什么? 没有TLB文件,Import进去有用么? 用OLE View看了,有接口,但是就是不行queryInterface中的GUID 和IID应该是那个啊,下面是我的IDL文件:// Generated .IDL file (by the OLE/COM Object Viewer)// // typelib filename: image.dll[ uuid(710993A2-4F87-41D7-B6FE-F5A20368465F), version(1.0), helpstring("Image 1.0 Type Library"), custom(DE77BA64-517C-11D1-A2DA-0000F8773CE9, 83951780), custom(DE77BA63-517C-11D1-A2DA-0000F8773CE9, 1079412854)]library ImageLib{ importlib("stdole2.tlb"); // Forward declare all types defined in this typelib interface IAnimator; [ uuid(06ADA938-0FB0-4BC0-B19B-0A38AB17F182), helpstring("Animator Class") ] coclass Animator { [default] interface IAnimator; }; [ odl, uuid(0C1CF2DF-05A3-4FEF-8CD4-F5CFC4355A16), helpstring("IAnimator Interface"), dual, nonextensible, oleautomation ] interface IAnimator : IDispatch { [id(0x00000001), helpstring("method LoadFromFile")] HRESULT LoadFromFile([in] BSTR FileName); };}; 问大家一个旋转文字裁切的问题 MFC中静态调用dll时如何指定dll的目录?? 动态创建 CWinApp* pApp 实例问题。 新手,如何按比例压缩位图? [求助]指针定位???? 谁有TCP/IP详解 卷2的 学习笔记, 可以给我一份吗?? 谢谢了 高难度问题:如何检测本机代理(满分恭候) 如何输出Dll中的定义的结构?? 卖钱不行卖分行不行呢,询问一下大家的意见? 登陆程序,为何在recv这里卡住了? 请问Oracle数据库的连接串是什么?高手帮帮忙啊~~~~~~~~在线等 关于模式对话框的问题
dll注册过了,没有头文件,用IDispatch接口怎么调用?能给一点示例代码么?我刚刚接触COM,对一些接口的概念有的模糊,请大家多多指教,谢谢!
to uno:
用引用没有用,在C#项目里面有用能看到接口,在VC++项目里面就看不到,不知道为什么?
queryInterface中的GUID 和IID应该是那个啊,下面是我的IDL文件:
// Generated .IDL file (by the OLE/COM Object Viewer)
//
// typelib filename: image.dll[
uuid(710993A2-4F87-41D7-B6FE-F5A20368465F),
version(1.0),
helpstring("Image 1.0 Type Library"),
custom(DE77BA64-517C-11D1-A2DA-0000F8773CE9, 83951780),
custom(DE77BA63-517C-11D1-A2DA-0000F8773CE9, 1079412854)]
library ImageLib
{
importlib("stdole2.tlb"); // Forward declare all types defined in this typelib
interface IAnimator; [
uuid(06ADA938-0FB0-4BC0-B19B-0A38AB17F182),
helpstring("Animator Class")
]
coclass Animator {
[default] interface IAnimator;
}; [
odl,
uuid(0C1CF2DF-05A3-4FEF-8CD4-F5CFC4355A16),
helpstring("IAnimator Interface"),
dual,
nonextensible,
oleautomation
]
interface IAnimator : IDispatch {
[id(0x00000001), helpstring("method LoadFromFile")]
HRESULT LoadFromFile([in] BSTR FileName);
};
};