void CConn::Draw(CDC *pDC)
{
CPen m_pen
m_pen.CreatePen(m_PenStyle,m_PenWidth,m_PenColor);
CPen* pen=(CPen*)pDC->SelectObject(&m_pen);
int oldDrawingMode=pDC->SetROP2(m_DrawingMode);
COLORREF OldColor=pDC->SetBkColor(m_BackgroundColor);
int OldBkMode=pDC->SetBkMode(m_BkMode);
COLORREF oldPenColor=pDC->SetTextColor(RGB(255,255,255));
Dll_handler=LoadLibrary("F:\\draw");
if(Dll_handler==NULL)
{
AfxMessageBox("qingjiancha"); return;
}
DLLDrawCon=(DLLDRAW)GetProcAddress(Dll_handler,"DrawCon");
DLLDrawCon(pDC,m_o_loc,m_s_color);
FreeLibrary(Dll_handler);
Dll_handler=NULL;
pDC->SetTextColor(oldPenColor); pDC->SelectObject(pen);
pDC->SetROP2(oldDrawingMode);
pDC->SetBkMode(m_BkMode);
}
这是dll的代码:
void CDrawApp::DrawCon(CDC* pDC,CPoint point,CString str)
{
pDC->MoveTo(point);
CPoint a=(100,100);
pDC->LineTo(point+a);
pDC->TextOut(point.x,point.y+10,str);}
{
CPen m_pen
m_pen.CreatePen(m_PenStyle,m_PenWidth,m_PenColor);
CPen* pen=(CPen*)pDC->SelectObject(&m_pen);
int oldDrawingMode=pDC->SetROP2(m_DrawingMode);
COLORREF OldColor=pDC->SetBkColor(m_BackgroundColor);
int OldBkMode=pDC->SetBkMode(m_BkMode);
COLORREF oldPenColor=pDC->SetTextColor(RGB(255,255,255));
Dll_handler=LoadLibrary("F:\\draw");
if(Dll_handler==NULL)
{
AfxMessageBox("qingjiancha"); return;
}
DLLDrawCon=(DLLDRAW)GetProcAddress(Dll_handler,"DrawCon");
DLLDrawCon(pDC,m_o_loc,m_s_color);
FreeLibrary(Dll_handler);
Dll_handler=NULL;
pDC->SetTextColor(oldPenColor); pDC->SelectObject(pen);
pDC->SetROP2(oldDrawingMode);
pDC->SetBkMode(m_BkMode);
}
这是dll的代码:
void CDrawApp::DrawCon(CDC* pDC,CPoint point,CString str)
{
pDC->MoveTo(point);
CPoint a=(100,100);
pDC->LineTo(point+a);
pDC->TextOut(point.x,point.y+10,str);}
file:i386\chkesp.c
line:42
the value of ESP was not properly saved across a function call,this is usually a result of a function declared with one calling convention with a function pointer declared with a different calling conventionesp是什么?