CoCreateInstance的函数原型吗? STDAPI CoCreateInstance( REFCLSID rclsid, //Class identifier (CLSID) of the object LPUNKNOWN pUnkOuter, //Pointer to controlling IUnknown DWORD dwClsContext, //Context for running executable code REFIID riid, //Reference to the identifier of the interface LPVOID * ppv //Address of output variable that receives // the interface pointer requested in riid );我的组件的CLSID为 CLSID_JNIBridger, 想获取的接口为 IID_IJNIBridger 接口申明为:interface IJNIBridger : public IUnknown {...}
如果,你的dll是标准dll的话(不能引用使用,只能声明使用),想要大家帮助你,你应该提供函数的原形声明
STDAPI CoCreateInstance(
REFCLSID rclsid, //Class identifier (CLSID) of the object
LPUNKNOWN pUnkOuter, //Pointer to controlling IUnknown
DWORD dwClsContext, //Context for running executable code
REFIID riid, //Reference to the identifier of the interface
LPVOID * ppv //Address of output variable that receives
// the interface pointer requested in riid
);我的组件的CLSID为 CLSID_JNIBridger, 想获取的接口为 IID_IJNIBridger
接口申明为:interface IJNIBridger : public IUnknown {...}
我的组件没有实现IDispatch接口,能用CreateObject来创建吗?
IJNIBridger *pBridger = NULL;
CoCreateInstance(CLSID_JNIBridger, NULL, CLSCTX_INPROC_SERVER, IID_IJNIBridger, (void**)&pBridger);
pBridger->Method1();
pBridger->Method2();
....
就可以对该组件进行调用了!
我现在的目的就是想在VB中怎样实现上面的过程?VB可不可以实现????