VC++错误:Run-Time Check Failure #0

Coby 2008-07-21 05:21:17
VC++错误:
运行时错误。是调用一个已编译成功的DLL,编译程序时工程没有错误。运行时出现下列错误提示。
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
...全文
76 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
Coby 2008-07-21
  • 打赏
  • 举报
回复
我刚才也看了好多这种和我一样错误的帖子都不一样。
Coby 2008-07-21
  • 打赏
  • 举报
回复
GetProAddress获取函数在我的程序里根本就没有。
Coby 2008-07-21
  • 打赏
  • 举报
回复
OnAdjustComponentSizes 函数:
void CDataCtrl::OnAdjustComponentSizes(RECT *grid,RECT *topHdg,RECT *sideHdg,
RECT *cnrBtn,RECT *vScroll,RECT *hScroll,RECT *tabs){
UNREFERENCED_PARAMETER(*grid);
UNREFERENCED_PARAMETER(*topHdg);
UNREFERENCED_PARAMETER(*sideHdg);
UNREFERENCED_PARAMETER(*cnrBtn);
UNREFERENCED_PARAMETER(*vScroll);
UNREFERENCED_PARAMETER(*hScroll);
UNREFERENCED_PARAMETER(*tabs);
}
ouyh12345 2008-07-21
  • 打赏
  • 举报
回复
This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.

调用约定不同
thirddata 2008-07-21
  • 打赏
  • 举报
回复
OnAdjustComponentSizes这个函数是怎么来的?
thirddata 2008-07-21
  • 打赏
  • 举报
回复
你在dll中定义的函数圆型跟你使用GetProAddress获取函数时所用的类型不同,检查一下代码吧,就在GetProAddress的地方
Coby 2008-07-21
  • 打赏
  • 举报
回复
补充一下代码:
//call the nofity function
OnAdjustComponentSizes(&m_GI->m_gridRect,&m_GI->m_topHdgRect,
&m_GI->m_sideHdgRect,&m_GI->m_cnrBtnRect,&m_GI->m_vScrollRect,
&m_GI->m_hScrollRect,&m_GI->m_tabRect);

if ( m_GI->m_paintMode == TRUE ) //此处是发生错误的断点
{
if(m_tabSizing)
{
m_CUGHScroll->MoveWindow(&m_GI->m_hScrollRect);
m_CUGTab->MoveWindow(&m_GI->m_tabRect);
m_CUGTab->Update();
m_CUGHScroll->Update();
ValidateRect(NULL);
}
else
{
m_CUGGrid->MoveWindow(&m_GI->m_gridRect);
m_CUGTopHdg->MoveWindow(&m_GI->m_topHdgRect);
m_CUGSideHdg->MoveWindow(&m_GI->m_sideHdgRect);
m_CUGCnrBtn->MoveWindow(&m_GI->m_cnrBtnRect);
m_CUGVScroll->MoveWindow(&m_GI->m_vScrollRect);
m_CUGHScroll->MoveWindow(&m_GI->m_hScrollRect);
m_CUGTab->MoveWindow(&m_GI->m_tabRect);

CalcTopRow();
CalcLeftCol();
Update();
}
}
//make sure that the scroll dimensions are put back to their
//original values
m_GI->m_vScrollWidth = vScrollWidth;
m_GI->m_hScrollHeight = hScrollHeight;

m_GI->m_tabWidth = origTabWidth;
m_GI->m_lastTopRow = m_GI->m_topRow;
m_GI->m_lastLeftCol = m_GI->m_leftCol;
}

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧