zoukankan      html  css  js  c++  java
  • AfxWinInit

    AfxWinInit函数用于初始化MFC.
    CWinApp 调MFC支持的WinMain, WinMain自动调AfxWinInit 做初始化。
    控制台程序不使用MFC支持的WinMain,所以要自己调用AfxWinInit来初始化MFC。
    ::GetModuleHandle 函数,取得当前模块的句柄 用作参数1。
    参数2必须是NULL。
    参数3取回命令行位置参数的函数,命令行 放入字符串。

    win32中程序举例:

    int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
    {
    	int nRetCode = 0;
    
    	// initialize MFC and print and error on failure
    	if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
    	{
    		// TODO: change error code to suit your needs
    		_tprintf(_T("Fatal Error: MFC initialization failed\n"));
    		nRetCode = 1;
    	}
    	else
    	{
                                   ......
                    }
    }
    
  • 相关阅读:
    iOS开源控件库收集
    Ruby中的几种除法
    Font
    PlaySound
    STL
    APIs
    cin and cout
    CreateWindow
    Introducing Direct2D
    VC 常用代码
  • 原文地址:https://www.cnblogs.com/CBDoctor/p/2865947.html
Copyright © 2011-2022 走看看