当前位置:编程学习 > C#/ASP.NET >>

ProcessShellCommand debug时出错 Release时不出错


// 出错信息如下

Debug Assertion Failed!

Program: ......\\*.exe
File: afxwin2.inl
Line: 44

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.

经过跟踪,在文件Wincore.cpp函数中出错
BOOL CWnd::CreateEx(DWORD dwExStyle, LPCTSTR lpszClassName,
LPCTSTR lpszWindowName, DWORD dwStyle,
int x, int y, int nWidth, int nHeight,
HWND hWndParent, HMENU nIDorHMenu, LPVOID lpParam)
{
AfxHookWindowCreate(this);
HWND hWnd = ::CreateWindowEx(cs.dwExStyle, cs.lpszClass,
cs.lpszName, cs.style, cs.x, cs.y, cs.cx, cs.cy,
cs.hwndParent, cs.hMenu, cs.hInstance, cs.lpCreateParams);// 执行到这里出错
......
} --------------------编程问答-------------------- 知道原因的老大,希望可以指点一二. --------------------编程问答-------------------- 非常感谢 --------------------编程问答-------------------- 出错时中断程序,在调用堆栈里面找最近的自己的代码来分析。
如果是调用CWnd::CreateEx直接出错而未产生任何消息,看一下是创建哪个窗口,各个参数是否正常,如果发现某个参数有问题,可以根据调用堆栈追溯该参数的来源。
对于Debug有错而Release没报错的情况,可能是程序中执行某个操作(例如打开某文件)失败而没有处理所致。检查一下程序是否使用了外部文件,注意Debug和Release的默认路径是不同的。
补充:.NET技术 ,  VC.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,