C#中使用COM组件的问题
我在C#中使用别人用C++写的一个COM组件,注册后,添加引用以及在对象浏览器内看不到这个组件。但我在C++中使用调用接口的方法可以使用,小弟对COM的细节了解不深,请求各位大侠能够指点一二,谢了!
那个COM组件用C++调用时tlh文件内的内容是这样的
#pragma once
#pragma pack(push, 8)
#include <comdef.h>
//
// Forward references and typedefs
//
struct __declspec(uuid("a6d6dc95-e289-47ce-b3fa-bff7ddf24eb1"))
/* LIBID */ __IMYPlugInLib;
struct /* coclass */ IMYPlugIn;
struct __declspec(uuid("8c0cee76-706b-4de9-85e3-977d967e0925"))
/* dual interface */ IMYComPlugIn;
//
// Smart pointer typedef declarations
//
_COM_SMARTPTR_TYPEDEF(IMYComPlugIn, __uuidof(IMYComPlugIn));
//
// Type library items
//
struct __declspec(uuid("5ee60022-1270-4fcb-b53d-a2a6fbaaa3b5"))
IMYPlugIn;
// [ default ] interface IMYComPlugIn
struct __declspec(uuid("8c0cee76-706b-4de9-85e3-977d967e0925"))
IMYComPlugIn : IDispatch
{
//
// Raw methods provided by interface
//
接口方法不列出了~~~~
};
//
// Named GUID constants initializations
//
extern "C" const GUID __declspec(selectany) LIBID_IMYPlugInLib =
{0xa6d6dc95,0xe289,0x47ce,{0xb3,0xfa,0xbf,0xf7,0xdd,0xf2,0x4e,0xb1}};
extern "C" const GUID __declspec(selectany) CLSID_IMYPlugIn =
{0x5ee60022,0x1270,0x4fcb,{0xb5,0x3d,0xa2,0xa6,0xfb,0xaa,0xa3,0xb5}};
extern "C" const GUID __declspec(selectany) IID_IMYComPlugIn =
{0x8c0cee76,0x706b,0x4de9,{0x85,0xe3,0x97,0x7d,0x96,0x7e,0x09,0x25}};
#pragma pack(pop)