对话框之间函数互调

在CImageArea类中调用CGIFJPGDlg类的DrawSelectedImage函数:

1. 在CImageArea类的.cpp文件中include CGIFJPGDlg类的头文件

#include "GIFJPGDlg.h"

 

2. 在要调用的函数中使用下面的语句:

void CImageArea::OnPaint()
{
 CPaintDC dc(this); // device context for painting
 // TODO: Add your message handler code here
 // Do not call CStatic::OnPaint() for painting messages

 CGIFJPGDlg*  pWnd = static_cast<CGIFJPGDlg*>(GetParent());
  pWnd->DrawSelectedImage();

}

你可能感兴趣的:(对话框之间函数互调)