这段代码里this指向CTestViewView
nextButton.AutoLoad(ID_NEXT, this)将this作为pParent传入

解决方案 »

  1.   

    对 onlynight(歧异) :
      可我不能传this进去,程序会出错,我得传个什么值进去才对呢?
      

  2.   

    程序编译没问题,但是一运行就出错,出错代码点为:
    VERIFY(nextButton.AutoLoad(ID_NEXT, this));//
    运行出错提示为:  出错标题 Microsoft visual c++ debug library
    /////////////////////////////////////////////////////
    Debug Assertion Failed!
    program: e:\...cpp
    line: 71
    for information on how your program can cause an assertion failure,see the visual C++ documentation on asserts.(Press retry to debug the application)
    ///////////////////////////////////////////////////////
    编译成Rel板本后,程序可运行,不出错,但是没有效果!
    各位老大,我只是在一个CFromView 单文档的程序里使用
    AutoLoad而以,我在类型为对话框应用程序里运行相同样的程序就可正确,运行通过,JIU JIU我吧,要不然,我又得把程序改成对话框,可是对话框程序又不支持菜单,SHIT,啊,,,我快烦死,难道就没几个英雄好汉指点我一下迷精,让我出这水深火热 的迷团VERIFY(nextButton.AutoLoad(ID_NEXT, this));//在CFormView中运行总出错,在对话框应用程序中运行可正常!!!!!!!!!!!
      

  3.   

    在msdn中看到如下:
    In the CDialog object’s OnInitDialog routine, call the CBitmapButton object’s AutoLoad function, using as parameters the button’s control ID and the CDialog object’s this pointer
      

  4.   

    还是不懂呀!唉,对话框支持菜单,这个我知道,可是不直接支持,我问的也不是这个,我想知道的是在CFromView中怎样正确的使用CBitmapButton的AutoLoad 而以,
      

  5.   

    CBitmapButton::AutoLoad 可能只能在对话框中使用,不过这里有一个简单的方法可以实现这样的操作。
    1.使用ClassWizard 将你的按钮与按钮类关联 比如m_btnMyTest
    2.在FormView 的头文件中找到定义m_btnMyTest,因该是CButton m_btnMyTest,改为CBitmapButton m_btnMyTest
    3.在OnInitialUpdate删除AutoLoad的调用,因为AutoLoad只是将按钮与控件关联 1,2部完成了以上的操作,接下来于Dialog中的一样
      

  6.   

    删除AUTOLOAD有没有搞错,那我的按钮还是不是图型钮呀!???唉!
    不过谢谢回答!