描述:
#include <olectl.h>
#include <idispids.h>
[ uuid(A4F5A21C-D400-419D-AC96-966B1F934CD4), version(1.0),
helpfile("pingcontrol1.hlp"),
helpstring("pingcontrol1 ActiveX Control module"),
control ]
library PINGCONTROL1Lib
{
importlib(STDOLE_TLB);
importlib(STDTYPE_TLB);
// Primary dispatch interface for CPingcontrol1Ctrl
[ uuid(018FC0F0-D379-45F9-AA3F-49408BF61638),
helpstring("Dispatch interface for Pingcontrol1 Control"), hidden ]
dispinterface _DPingcontrol1
{
properties:
// NOTE - ClassWizard will maintain property information here.
// Use extreme caution when editing this section.
//{{AFX_ODL_PROP(CPingcontrol1Ctrl)
//}}AFX_ODL_PROP
methods:
// NOTE - ClassWizard will maintain method information here.
// Use extreme caution when editing this section.
//{{AFX_ODL_METHOD(CPingcontrol1Ctrl)
//}}AFX_ODL_METHOD
[id(DISPID_ABOUTBOX)] void AboutBox();
};
// Event dispatch interface for CPingcontrol1Ctrl
[ uuid(CDBEAB87-2E7C-421A-8E8C-FA6C594FDDCA),
helpstring("Event interface for Pingcontrol1 Control") ]
dispinterface _DPingcontrol1Events
{
properties:
// Event interface has no properties
methods:
// NOTE - ClassWizard will maintain event information here.
// Use extreme caution when editing this section.
//{{AFX_ODL_EVENT(CPingcontrol1Ctrl)
//}}AFX_ODL_EVENT
};
// Class information for CPingcontrol1Ctrl
[ uuid(088512AF-768B-4534-B9F9-3BC41F98E5CF),
helpstring("Pingcontrol1 Control"), control ]
coclass Pingcontrol1
{
[default] dispinterface _DPingcontrol1;
[default, source] dispinterface _DPingcontrol1Events;
};
//{{AFX_APPEND_ODL}}
//}}AFX_APPEND_ODL}}
};
==================================================
<html>
<head>
<title> </title>
</head>
<OBJECT ID= "pingcontrol1"
CLASSID= "clsid:A4F5A21C-D400-419D-AC96-966B1F934CD4"
CODEBASE= "pingcontrol1.ocx"
align=center>
</OBJECT>
<body>
</body>
</html>
==================================================
关键是clsid和id不知道设置的对不对,网页里面看不到控件
解决方案1:
属性化编程只是减少了一写程序员要写代码量而已.居然属性化编程能实现,非属性化的岂有不能实现的道理.
属性化编程与否与客户端使用无关.客户不会关注你是如何编程的,只会关注你提供的接口解决方案2:
自己google去,网上大把的教程
属性化编程介绍
http://www.builder.com.cn/2007/1105/606687.shtml解决方案3:
1. CLSID:088512AF-768B-4534-B9F9-3BC41F98E5CF
一般是coclass关键字前面的CLSID
2. 另外要打包成cab压缩文件,而不是直接'pingcontrol1.ocx'.
3. ID可以随便设置
4. 没事别搞什么属性化编程,这项技术ms都快抛弃的.而且整的代码自己看不懂,别人也看不懂