step 1:vc 6.0中建立一个win32 application
step 2:工程---->设置---->general----->use mfc in a shared dll
文件:头文件hello.h 和 hello.cpp
hello.h中的内容:
class CMyApp : public CWinApp
{
public:
virtual BOOL InitInstance();
};class CMainWindow : public CFrameWnd 
{
public:
CMainWindow();
protected:
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP();//声明消息映射
};hello.cpp中的内容
#include <afxwin.h>
#include "hello.h"CMyApp myApp;BOOL CMyApp::InitInstance()
{
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}BEGIN_MESSAGE_MAP(CMainWindow,CFrameWnd)
ON_WM_PAINT()
END_MESSAGE_MAP()CMainWindow::CMainWindow()
{
Create(NULL,"MFC运行机制演示程序!");
}void CMainWindow::OnPaint()
{
CPaintDC dc(this);
CRect rect;
GetClientRect(&rect);
dc.DrawText("Hello MFC",-1,&rect,DT_SINGLELINE | DT_CENTER | DT_VCENTER);

}
 结果
--------------------Configuration: ManualMFC - Win32 Debug--------------------
Compiling...
Skipping... (no relevant changes detected)
hello.cpphello.obj - 0 error(s), 0 warning(s)
但是
运行时候出现:
应用程序错误,内存**不能为read请问是哪里出问题了