在網頁裏用的時候須要知道他的classid
我在代碼中看到有web
const GUID CDECL BASED_CODE _tlid = { 0x89201950, 0x2CAC, 0x4CF7, { 0x99, 0x8, 0x73, 0x38, 0x61, 0x41, 0xEF, 0xD2 } };
這個,可別人的都是10進制的啊?ui
#include <olectl.h> #include <idispids.h> [ uuid(89201950-2CAC-4CF7-9908-73386141EFD2), version(1.0), helpfile("activex.hlp"), helpstring("activex ActiveX Control module"), control ] library activexLib { importlib(STDOLE_TLB); // Primary dispatch interface for CactivexCtrl [ uuid(88F1FDE7-7BD4-48FD-9D0C-6C2AEA01D7FC), helpstring("Dispatch interface for activex Control")] dispinterface _Dactivex { properties: methods: [id(DISPID_ABOUTBOX)] void AboutBox(); }; // Event dispatch interface for CactivexCtrl [ uuid(8DE3C33B-2B0B-4669-A636-B6FD893DF39F), helpstring("Event interface for activex Control") ] dispinterface _DactivexEvents { properties: // Event interface has no properties methods: }; // Class information for CactivexCtrl [ uuid(5161E46C-C157-4BC7-9DB7-7597617722F0), helpstring("activex Control"), control ] coclass activex { [default] dispinterface _Dactivex; [default, source] dispinterface _DactivexEvents; }; };
這麼多 哪一個纔是?spa
回答:.net
[ uuid(5161E46C-C157-4BC7-9DB7-7597617722F0),
helpstring("activex Control"), control ]
coclass activex
-----------------------------------
5161E46C-C157-4BC7-9DB7-7597617722F0這個就是,其實就是C++ MFC項目中生成的idl文件中的最後一個GUIDcode
而後在web中調用以下,便可:orm
<object id="activex" classid="clsid:5161E46C-C157-4BC7-9DB7-7597617722F0"></object>
原帖地址blog