我的程序可以编译,但执行时出现内存不能读错误,按取消调试在
inline _variant_t::_variant_t(IDispatch* pSrc, bool fAddRef) throw()
{
V_VT(this) = VT_DISPATCH;
V_DISPATCH(this) = pSrc; // Need the AddRef() as VariantClear() calls Release(), unless fAddRef
// false indicates we're taking ownership
//
if (fAddRef) {
V_DISPATCH(this)->AddRef();//此处出现内存不能读的错误
}
}
的V_DISPATCH(this)->AddRef();语句处出现内存不能读的错误!如果单步调试,调试到CMy1App::InitInstance()中if (!ProcessShellCommand(cmdInfo)
)处开始不能继续单步调试,出现异常。请问这是为什么?
BOOL CMy1App::InitInstance()
{
// CG: The following block was added by the Splash Screen component. {
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
CSplashWnd::EnableSplashScreen(cmdInfo.m_bShowSplash);
}
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU) // Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CMy1Doc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CMy1View));
AddDocTemplate(pDocTemplate);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))\\在此处开始不能继续单步调试,出现异常
return FALSE;
// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
m_pMainWnd->UpdateWindow();
return TRUE;
}谢谢了!
inline _variant_t::_variant_t(IDispatch* pSrc, bool fAddRef) throw()
{
V_VT(this) = VT_DISPATCH;
V_DISPATCH(this) = pSrc; // Need the AddRef() as VariantClear() calls Release(), unless fAddRef
// false indicates we're taking ownership
//
if (fAddRef) {
V_DISPATCH(this)->AddRef();//此处出现内存不能读的错误
}
}
的V_DISPATCH(this)->AddRef();语句处出现内存不能读的错误!如果单步调试,调试到CMy1App::InitInstance()中if (!ProcessShellCommand(cmdInfo)
)处开始不能继续单步调试,出现异常。请问这是为什么?
BOOL CMy1App::InitInstance()
{
// CG: The following block was added by the Splash Screen component. {
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
CSplashWnd::EnableSplashScreen(cmdInfo.m_bShowSplash);
}
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU) // Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CMy1Doc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CMy1View));
AddDocTemplate(pDocTemplate);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))\\在此处开始不能继续单步调试,出现异常
return FALSE;
// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
m_pMainWnd->UpdateWindow();
return TRUE;
}谢谢了!
解决方案 »
- #include<WinFax.h>????????????
- 用VC++实现“字体的笔画借助OpenGL绘制的六面体实现”(100分,谢谢)
- 如何写一个自定义组合框
- 请问,调用哪个函数可以知道windows已经安装了某个软件如(winamp程序)呢?
- 求救?关于tcp udp服务器
- 两个程序分别用两个OBDC连接访问ACCESS同一数据库中的不同的表!有没有影响
- 开发fax遇到的驱动配置问题,up有分,解答者150分!
- MFC扩展Dll中,加入Menu资源的问题。
- MFC中 我在单文档中插入了一张图 怎样使鼠标自动显示图片上的坐标
- 深入浅出 问题 8 菜鸟求助
- 工程在Debug配置下怎么无法单步调试啊
- 怎样检测计算机的分辨率是否为800*600 如果不是怎样强行的设置为800*600?在程序退出时恢复原来的?
{
V_DISPATCH(this)->AddRef();//此处出现内存不能读的错误
}
空指针吧?