资源简介

在VC程序里如何调用第三程序并内嵌到自己的窗口里做为子窗口,本程序给出一个很好的例子

资源截图

代码片段和文件信息

// HostMSPaint.cpp : Defines the class behaviors for the application.
//

#include “stdafx.h“
#include “HostMSPaint.h“
#include “HostMSPaintDlg.h“

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CHostMSPaintApp

BEGIN_MESSAGE_MAP(CHostMSPaintApp CWinApp)
ON_COMMAND(ID_HELP CWinApp::onhelp)
END_MESSAGE_MAP()

CHostMSPaintApp::CHostMSPaintApp()
{

}

/////////////////////////////////////////////////////////////////////////////
// The one and only CHostMSPaintApp object

CHostMSPaintApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CHostMSPaintApp initialization

BOOL CHostMSPaintApp::InitInstance()
{
AfxEnableControlContainer();

#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif

CHostMSPaintDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
//  dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
//  dismissed with Cancel
}

// Since the dialog has been closed return FALSE so that we exit the
//  application rather than start the application‘s message pump.
return FALSE;
}


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        1222  2007-05-08 22:14  HostMSPaint.clw
     文件        1509  2011-07-09 16:14  HostMSPaint.cpp
     文件        4249  2007-05-08 22:00  HostMSPaint.dsp
     文件         547  2007-05-08 22:00  HostMSPaint.dsw
     文件         795  2011-07-09 16:14  HostMSPaint.h
     文件       41984  2007-05-08 22:22  HostMSPaint.ncb
     文件       48640  2007-05-08 22:22  HostMSPaint.opt
     文件         256  2007-05-08 22:22  HostMSPaint.plg
     文件        6937  2011-07-09 16:21  HostMSPaint.rc
     文件         888  2011-07-08 22:12  HostMSPaint.sln
     文件        7944  2011-07-09 10:12  HostMSPaint.vcxproj
     文件        1940  2011-07-08 22:11  HostMSPaint.vcxproj.filters
     文件         143  2011-07-08 22:11  HostMSPaint.vcxproj.user
     文件        6436  2011-07-09 16:16  HostMSPaintDlg.cpp
     文件        1099  2011-07-09 16:15  HostMSPaintDlg.h
     文件        3669  2007-05-08 22:00  ReadMe.txt
     文件         915  2011-07-09 16:19  resource.h
     文件         213  2007-05-08 22:00  StdAfx.cpp
     文件        1054  2007-05-08 22:00  StdAfx.h
     目录           0  2011-07-09 15:51  res\
     文件       58782  2011-04-23 19:16  res\HostMSPaint.ico
     文件         403  2007-05-08 22:00  res\HostMSPaint.rc2
     文件       39116  2011-07-09 16:21  HostMSPaint.aps

评论

共有 条评论