在网页里用的时候需要知道他的classid
我在代码中看到有

const GUID CDECL BASED_CODE _tlid =
    { 0x89201950, 0x2CAC, 0x4CF7, { 0x99, 0x8, 0x73, 0x38, 0x61, 0x41, 0xEF, 0xD2 } };

这个,可别人的都是10进制的啊?

 

自己写个activex控件,如何知道他的classid(转载)
#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;
 };

 };
自己写个activex控件,如何知道他的classid(转载)

这么多 哪个才是?

 

回答:

[ uuid(5161E46C-C157-4BC7-9DB7-7597617722F0),
  helpstring("activex Control"), control ]
coclass activex
-----------------------------------
5161E46C-C157-4BC7-9DB7-7597617722F0这个就是,其实就是C++ MFC项目中生成的idl文件中的最后一个GUID

 

然后在web中调用如下,即可:

<object ></object>

 

原帖地址

相关文章:

  • 2021-11-28
  • 2022-03-02
  • 2021-10-15
  • 2021-05-07
  • 2021-11-08
  • 2021-08-07
  • 2022-12-23
猜你喜欢
  • 2022-02-15
  • 2021-08-01
  • 2021-09-29
  • 2022-02-11
  • 2021-05-17
  • 2021-12-09
相关资源
相似解决方案