用ActiveX Control Test Container试一下,先卸载该控件,然后再注册(不要用Regsvr32)
不行了,太多年没有用VC了. 是什么控件,能不能用VB改写?
正在用VC开发,用到许多自己开发的DLL。 不能用VB改写:(
不管如何,谢谢Cooly先!自己继续UP
对了,你用html可以调用这个控件? 如果可以就说明注册成功了.
but vb can not use it when put the activeX on form vb pop up a dialog said: class not registered looking for object with CLSID:{---}
我用MFC写的控件可以在VB使用,不知你的是否用MFC写的。
把你的IDL贴上来,让大家帮你看看
// Winmap.odl : type library source for ActiveX Control project.// This file will be processed by the Make Type Library (mktyplib) tool to // produce the type library (Winmap.tlb) that will become a resource in // Winmap.ocx.#include <olectl.h> #include <idispids.h>[ uuid(F540A4C2-6FE4-11D7-9F17-001088512413), version(1.0), helpfile("Winmap.hlp"), helpstring("Winmap ActiveX Control module"), control ] library WINMAPLib { importlib(STDOLE_TLB); importlib(STDTYPE_TLB); // Primary dispatch interface for CWinmapCtrl [ uuid(F540A4C3-6FE4-11D7-9F17-001088512413), helpstring("Dispatch interface for Winmap Control"), hidden ] dispinterface _DWinmap { properties: // NOTE - ClassWizard will maintain property information here. // Use extreme caution when editing this section. //{{AFX_ODL_PROP(CWinmapCtrl) //}}AFX_ODL_PROP methods: // NOTE - ClassWizard will maintain method information here. // Use extreme caution when editing this section. //{{AFX_ODL_METHOD(CWinmapCtrl) [id(1)] boolean BuildConnect(); //}}AFX_ODL_METHOD [id(DISPID_ABOUTBOX)] void AboutBox(); }; // Event dispatch interface for CWinmapCtrl [ uuid(F540A4C4-6FE4-11D7-9F17-001088512413), helpstring("Event interface for Winmap Control") ] dispinterface _DWinmapEvents { properties: // Event interface has no properties methods: // NOTE - ClassWizard will maintain event information here. // Use extreme caution when editing this section. //{{AFX_ODL_EVENT(CWinmapCtrl) //}}AFX_ODL_EVENT }; // Class information for CWinmapCtrl [ uuid(F540A4C5-6FE4-11D7-9F17-001088512413), helpstring("Winmap Control"), control ] coclass Winmap { [default] dispinterface _DWinmap; [default, source] dispinterface _DWinmapEvents; }; //{{AFX_APPEND_ODL}} //}}AFX_APPEND_ODL}} };
不能用VB改写:(
when put the activeX on form
vb pop up a dialog
said:
class not registered
looking for object with CLSID:{---}
// produce the type library (Winmap.tlb) that will become a resource in
// Winmap.ocx.#include <olectl.h>
#include <idispids.h>[ uuid(F540A4C2-6FE4-11D7-9F17-001088512413), version(1.0),
helpfile("Winmap.hlp"),
helpstring("Winmap ActiveX Control module"),
control ]
library WINMAPLib
{
importlib(STDOLE_TLB);
importlib(STDTYPE_TLB); // Primary dispatch interface for CWinmapCtrl [ uuid(F540A4C3-6FE4-11D7-9F17-001088512413),
helpstring("Dispatch interface for Winmap Control"), hidden ]
dispinterface _DWinmap
{
properties:
// NOTE - ClassWizard will maintain property information here.
// Use extreme caution when editing this section.
//{{AFX_ODL_PROP(CWinmapCtrl)
//}}AFX_ODL_PROP methods:
// NOTE - ClassWizard will maintain method information here.
// Use extreme caution when editing this section.
//{{AFX_ODL_METHOD(CWinmapCtrl)
[id(1)] boolean BuildConnect();
//}}AFX_ODL_METHOD [id(DISPID_ABOUTBOX)] void AboutBox();
}; // Event dispatch interface for CWinmapCtrl [ uuid(F540A4C4-6FE4-11D7-9F17-001088512413),
helpstring("Event interface for Winmap Control") ]
dispinterface _DWinmapEvents
{
properties:
// Event interface has no properties methods:
// NOTE - ClassWizard will maintain event information here.
// Use extreme caution when editing this section.
//{{AFX_ODL_EVENT(CWinmapCtrl)
//}}AFX_ODL_EVENT
}; // Class information for CWinmapCtrl [ uuid(F540A4C5-6FE4-11D7-9F17-001088512413),
helpstring("Winmap Control"), control ]
coclass Winmap
{
[default] dispinterface _DWinmap;
[default, source] dispinterface _DWinmapEvents;
};
//{{AFX_APPEND_ODL}}
//}}AFX_APPEND_ODL}}
};
[email protected]
20M
TOO LARGE.
55555....
用MFC做ActiceX比用ATL的复杂度要高得多高,我一般都用ATL,不会用MFC做COM。
按COM理论来讲,你可以者让做做试试:
in .IDL
[id(1)] HRESULT BuildConnect([out, retval] VARIANT_BOOL *pVal);in .h
STDMETHOD(BuildConnect)(/*[out, retval]*/ VARIANT_BOOL* pVal);行不行我就不知道了,如你试了请把结果告诉我一声。另外你再做什么?和MapInfo or GIS 有关?
导出类不行,导出函数却可以,
虽然问题不见了,但不明白为什么。
不用MAPINFO
基本上都是自己开发的。