티스토리 뷰

MFC

HWND 와 HINSTANCE 차이

gyunene 2019. 7. 24. 10:32

 

 

HWND

A handle to a window.

This type is declared in WinDef.h as follows:

typedef HANDLE HWND;

HINSTANCE

A handle to an instance. This is the base address of the module in memory.

HMODULE and HINSTANCE are the same today, but represented different things in 16-bit Windows.

This type is declared in WinDef.h as follows:

typedef HANDLE HINSTANCE;

 

1. hInstance로 hwnd를 알 수 있다. 

2. hwnd = CWnd클래스의 Create함수 호출시 생성되는 창을 식별하는 핸들

3. hinstance = 윈도우에서 메모리에 올라온 모듈을 관리하기 위해 부여된 코드가 담긴 인스턴스 핸들

4. dll 모듈 하나를 실행하면 hinstance 인스턴스 핸들이 하나 생긴다. 

 

new CDynLinkLibrary( ) 로 dll모듈하나를 로드한 후

hinstance를 저장해두길래 이유를 찾으며...

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
글 보관함