我是想用MFC ActiveX ControlWizard制作Target.ocx或Target.dll,这个东西最后要用ASP插入到网页中,假如我要的CMyListCtrl与原来CListCtrl实现完全一样的功能,是不是必须要从头来过啊?!能不能通过继承而利用原有的东西啊?还有一个具体问题在MFC ActiveX ControlWizard建立的工程下,我要用ClassWizard为控件增加一个属性,并且同时加入Get/Set函数。
如果这个属性的类型在ClassWizard所提供的数据类型下拉列表框中(大概有24种)不存在,怎么办?
如果Get/Set函数的返回值或参数的类型也找不到怎么办?
比如
class CListCtrl : public CWnd
{
……
CImageList* GetImageList(int nImageList) const;
CImageList* SetImageList(CImageList* pImageList, int nImageListType);
……
}
这两个函数怎么实现?请各位多给建议,先行谢过。

解决方案 »

  1.   

    我也在了解这方面的,我要使用 Slider 滑动控件作为基类,将他变成 圆盘形的,该怎么做啊。楼主可以告诉一下你的做法吗?
      

  2.   

    1.implement your ocx as dialog form ,then insert your derived Listctrl class,consult 
    http://www.codeguru.com/activex/dialogctrl.shtml
    2. you can deal with by hand ,not use classwinzard.
      

  3.   

    你去吧CListCtrl的源代码都挖出来,然后copy到activex中你的工程中。这样理论上是可以的。
    不过我没式过。
      

  4.   

    CListCtrl没有数据成员和虚函数,所以可以把CWnd对象指针直接强制转换成CListCtrl对象指针之后使用
    CMyListCtrl:public COleControl
    {
    ......
    CListCtrl* GetListCtrl(){return (CListCtrl*)this;}
    Command what is yours
    Conquer what is not