hwimplicituse.cpp

来自「C++编程实践与技巧一书各章节的源码」· C++ 代码 · 共 71 行

CPP
71
字号
// HWImplicitUse.cpp : Defines the entry point for the application.
//

#include "stdafx.h"
#include "HWImplicitUse.h"

//CMainApp Implementation
CMainApp::CMainApp()
{}

CMainApp::~CMainApp()
{}

BOOL CMainApp::InitInstance()
{
	if (!CWinApp::InitInstance())
		return FALSE;
    CMainWnd* t_pMainWnd=new CMainWnd();
	if (t_pMainWnd==NULL)
		return FALSE;
	
	m_pMainWnd=t_pMainWnd;
    
	m_pMainWnd->ShowWindow(m_nCmdShow);
    m_pMainWnd->UpdateWindow();

	return TRUE;
}

int CMainApp::Run( )
{
	CClientDC m_DemoDC(m_pMainWnd);
	char szDLLParams[]="                                            ";
	CWDllDemo* t_hwDLLClass=new CWDllDemo();
	
	int t_iDLLClassVar=t_hwDLLClass->WDllFunc();
	wsprintf(szDLLParams,"WDllFunc=%d",t_iDLLClassVar);
	m_DemoDC.TextOut(0,0,szDLLParams);
	
	t_iDLLClassVar=t_hwDLLClass->m_WDllData;
	wsprintf(szDLLParams,"m_WDllData=%d",t_iDLLClassVar);
	m_DemoDC.TextOut(0,15,szDLLParams);

	t_iDLLClassVar=m_outclass;
	wsprintf(szDLLParams,"m_outclass=%d",t_iDLLClassVar);
	m_DemoDC.TextOut(0,30,szDLLParams);

	UINT t_bDLLExpFunc=(UINT)OutFunc(FALSE);
	wsprintf(szDLLParams,"OutFunc(FALSE)=%d",t_bDLLExpFunc);
	m_DemoDC.TextOut(0,45,szDLLParams);

	
    return CWinApp::Run();
}


CMainApp MainApplication;

//CMainWnd Implementation
CMainWnd::CMainWnd()
{
	Create(NULL,"Win32 DLL测试程序");
}

CMainWnd::~CMainWnd()
{
}



⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?