But, when writing the idl interface description file found in the library cannot be identified, the parameters for each error,
Checked, have said Windows SDK question, has said the category can't identify problems, should be the latter, I installed vs time and later did not encounter the problem of the SDK,
So, how to correct the idl file to add custom categories, parameters can be function??
Post code:
//ComCaffe. Idl: ComCaffe idl source
//
//this file will be handled by MIDL tools to
//produce type library (ComCaffe. TLB) and marshaling code,
Import "oaidl. Idl";
Import "ocidl. Idl";
Object,
Uuid (1 fafcf35 - AF35-45 Ed - BD61 - B7DB1B08C816),
Dual,
Nonextensible,
Pointer_default (unique)
]
Interface ISimpleObject: IDispatch {
[id (1)] HRESULT ComServiceGTHC_VMT_NET_SetCallBack ([in] HC_VMT_NET_LoginProc pLoginProc, [in] HC_VMT_NET_ErrorProc pErrProc, [in] HC_VMT_NET_MessageProc pMsgProc, [in] HC_VMT_NET_PlayErrorProc pLiveErrProc, [in] DWORD dwUser, [out, retval] LONG * ret);
[id (2)] HRESULT ComServiceGTHC_VMT_NET_PTZCtrl (char * resId [in], [in] char * URL, [out, retval] LONG * ret);
[id (3)] HRESULT ComServiceGTHC_VMT_NET_PlayOpen (LONG * hPlayer [in], [in] the HWND HWND, char * [in] the resource, [in] char * URL, [in] HC_VMT_NET_PPlayProc playProc, [in] DWORD playProcUser, [in] HC_VMT_NET_PStreamMessageProc msgProc, [out, retval] LONG * ret);
(4) [id] HRESULT ComServiceGTHC_VMT_NET_PlayCtrl ([in] LONG hPlayer, [in] char * URL, [out, retval] LONG * ret);
(5) [id] HRESULT ComServiceGTHC_VMT_NET_PlayClose ([in] LONG hPlayer, [out, retval] LONG * ret);
[id (6)] HRESULT ComServiceGTHC_VMT_NET_Logout (ret) [out, retval] LONG *;
[id (7)] HRESULT ComServiceGTHC_VMT_NET_Login (char * strip [in], [in] WORD wPort, [in] char * username, [in] char * password, [in] the int version, [out, retval] LONG * ret);
[id (8)] HRESULT ComServiceGTHC_VMT_NET_LayoutSize (ret) [out, retval] LONG *;
[id (9)] HRESULT ComServiceGTHC_VMT_NET_LayoutGroupSize (const char * layoutId [in], [out, retval] LONG * ret);
[id (10)] HRESULT ComServiceGTHC_VMT_NET_LayoutGroup (const char * layoutId [in], [in] GTHC_VMT_NET_GROUP * pGroup, [in] the int size, [out, retval] LONG * ret);
[id (11)] HRESULT ComServiceGTHC_VMT_NET_Layout ([in] GTHC_VMT_NET_LAYOUT * pLayout, [in] the int size, [out, retval] LONG * ret);
[id (12)] HRESULT ComServiceGTHC_VMT_NET_InitLib ([in] VARIANT_BOOL cache_data, [out, retval] LONG * ret);
[id (13)] HRESULT ComServiceGTHC_VMT_NET_GroupResourceSize (const char * layoutId [in], [in] the int * deptSize, [in] const char * groupId, [in] resSize int * and [out, retval] LONG * ret);
[id (14)] HRESULT ComServiceGTHC_VMT_NET_GroupResource (const char * layoutId [in], [in] const char * groupId, [in] GTHC_VMT_NET_DEPT * pDept, [in] the int deptSize, [in] GTHC_VMT_NET_RESOURCE * pRes, [in] the int resSize, [out, retval] LONG * ret);
[id (15)] HRESULT ComServiceGTHC_VMT_NET_GetRes (char * resId [in], [in] GTHC_VMT_NET_RESOURCE * pRes, [out, retval] LONG * ret);
[id (16)] HRESULT ComServiceGTHC_VMT_NET_GetPreset (const char * user [in], [out, retval] LONG * ret);
[id (17)] HRESULT ComServiceGTHC_VMT_NET_FiniLib (ret) [out, retval] LONG *;
[id (18)] HRESULT ComServiceGTHC_VMT_NET_AlarmResSize ([in] the int type, [out, retval] LONG * size);
[id (19)] HRESULT ComServiceGTHC_VMT_NET_AlarmRes ([in] the int type, [in] GTHC_VMT_NET_RESOURCE * pRes, [in] the int size, [out, retval] LONG * ret);
};
Uuid (151 eccab - e4c68 e40 - A606 F5C8-4-5769278),
Version (1.0),
]
The library ComCaffeLib
{
Stdole2. TLB importlib (" ");
Uuid (92579859-45 ae BB5A - - A6F3-38 c28d84f72a)
]
Coclass SimpleObject
{
[default] interface ISimpleObject;
};
};
Parameters of category by DLL lib corresponding. I'd like to encapsulate defined h:
Thank you all for the great god
CodePudding user response:
In a 64 - bit Windows:64 exe and DLL in the directory c: \ Windows \ system32 directory.
32-bit exe and DLL in the directory c: \ Windows \ syswow64 directory;
So pay attention to:
In win64 system registered under 32-bit ocx DLL to 32 ocx or copy the DLL to the c: \ Windows \ syswow64 \ directory,
And registered to c: \ Windows \ syswow64 \ regsvr32 XXXXXXX ocx or DLL
A 64 - bit Windows platform attention point of the file system redirection http://www.cnblogs.com/jiake/p/4981555.html
64 - bit Windows registry to redirect http://www.cnblogs.com/jiake/p/4956218.html platform attention point
CodePudding user response:
The IDL language does not support function types so your IDL itself is wrong,To transfer function, you can use a wrapper class, IE for the realization of the javascript function is an IDispatch, calling function method is to use the special disp id 0 to Invoke,
Some language type system does not support IDispatch, if need to support more languages (such as javascript), need to use the VARIANT package again,