http://expert.csdn.net/Expert/topic/1667/1667031.xml?temp=.9333002
VC写的控件,在VB里无法使用,但是VC和ACTIVEXTESTER可以使用,放到IE里也可以使用,该怎么解决这个问题。

解决方案 »

  1.   

    用ActiveX Control Test Container试一下,先卸载该控件,然后再注册(不要用Regsvr32)
      

  2.   

    不行了,太多年没有用VC了. 是什么控件,能不能用VB改写?
      

  3.   

    正在用VC开发,用到许多自己开发的DLL。
    不能用VB改写:(
      

  4.   

    不管如何,谢谢Cooly先!自己继续UP
      

  5.   

    对了,你用html可以调用这个控件? 如果可以就说明注册成功了.
      

  6.   

    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:{---}
      

  7.   

    我用MFC写的控件可以在VB使用,不知你的是否用MFC写的。
      

  8.   

    把你的IDL贴上来,让大家帮你看看
      

  9.   

    // 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}}
    };
      

  10.   

    哥们!把那个控件发给我们试试!
    [email protected]
      

  11.   

    tO:lxcc(虫莲) 
    20M
    TOO LARGE.
    55555....
      

  12.   

    问题大概是出在你使用的是MFC而不是ATL上,因为在VB只支持IDispatch,不支持vtable。
    用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 有关?
      

  13.   

    问题解决了,是__declspec(dllexport)的问题。
    导出类不行,导出函数却可以,
    虽然问题不见了,但不明白为什么。
      

  14.   

    偶做的是地图程序
    不用MAPINFO
    基本上都是自己开发的。