CWinApp::m_hInstance
해당 하는 hInstance 매개 변수를 전달 하려면 windows WinMain.
HINSTANCE m_hInstance;
설명
m_hInstance 데이터 멤버는 Windows에서 실행 되는 응용 프로그램의 현재 인스턴스 핸들입니다.전역 함수에 의해 반환 되는이 AfxGetInstanceHandle.m_hInstance형식의 public 변수는 HINSTANCE.
예제
// Typically you do not need to pass the application's hInstance
// to Windows APIs directly because there are equivalent MFC
// member functions that pass the hInstance for you. The following
// example is not typical:
HCURSOR hCursor;
hCursor = ::LoadCursor(AfxGetApp()->m_hInstance,
MAKEINTRESOURCE(IDC_MYCURSOR));
// A more direct way to get the application's hInstance is to
// call AfxGetInstanceHandle:
hCursor = ::LoadCursor(AfxGetInstanceHandle(),
MAKEINTRESOURCE(IDC_MYCURSOR));
// If you need the hInstance to load a resource, it is better
// to call AfxGetResourceHandle instead of AfxGetInstanceHandle:
hCursor = ::LoadCursor(AfxGetResourceHandle(),
MAKEINTRESOURCE(IDC_MYCURSOR));
// A better way to load the cursor resource is to call
// CWinApp::LoadCursor
hCursor = AfxGetApp()->LoadCursor(IDC_MYCURSOR);
요구 사항
헤더: afxwin.h