程序编译没问题,但是一运行就出错,出错代码点为: 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中运行总出错,在对话框应用程序中运行可正常!!!!!!!!!!!
在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
可我不能传this进去,程序会出错,我得传个什么值进去才对呢?
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中运行总出错,在对话框应用程序中运行可正常!!!!!!!!!!!
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
1.使用ClassWizard 将你的按钮与按钮类关联 比如m_btnMyTest
2.在FormView 的头文件中找到定义m_btnMyTest,因该是CButton m_btnMyTest,改为CBitmapButton m_btnMyTest
3.在OnInitialUpdate删除AutoLoad的调用,因为AutoLoad只是将按钮与控件关联 1,2部完成了以上的操作,接下来于Dialog中的一样
不过谢谢回答!