Published 2020. 10. 26. 14:18

1. API 에서는 유니코드 문자집합을 사용하느냐, 멀티바이트 문자집합을 사용하느냐에 따라, 데이터 타입이 살짝 다르다.

 

2. 또한 프로그램의 진입점 또한 다르다. 멀티바이트에서는 WinMain을 사용하고, 유니코드에서는 wWinMain을 사용한다. _tWinMain을 사용하면 자동으로 바뀐다.

 

3. MFC를 사용하지 않는 이유

  • MFC는 API를 기반으로 만들어졌으며, API의 wrapper에 지나지 않는다.
  • MFC를 사용하느니 차라리, UWP를 사용하는 것이 낳다.

4. API 에서 렌더링을 하고자 할때, GDI를 사용하지 않는 것이 좋다. GDI는 너무 오래 되었고, Vulcan, OpenGL, DirectX 라는 좋은 옵션들이 있기 때문이다.

 

5. 프로그램 자체 exe 는 hInstance에 대응된다. 그러므로, 여러개의 창을 가지는 프로그램은 창마다 자기자신의 hWnd를 가질 수 있지만, hInstance 는 바뀔 수 없다.

 

6. 프로시저 함수를 클래스에 넣고 싶을때, namespace를 이용하는 트릭과 WNDCLASS 안에 UserData를 이용하는 방법이 있는데, 후자가 더 깔끔하고 많은 프로그래머들이 권장하는 방법이다.

 

7. 엔트리 포인트의 hPrevInstance는 이전 버전의 흔적일뿐 API에서는 사용하지 않는 변수이다. 프로시저 함수의 wParam과 lParam은 각각 16bit, 32bit의 변수였지만, 지금은 둘다 32bit를 쓴다.

 

8. 현재는 주식거래 빼고는 Win32 API를 이용할 이유가 없다. C Base이고 일단은 가장 빠르기 때문에.

 

 

참고할만한 레퍼런스는 다음과 같다.

 

Building a Win32 App, Part 2: Windows and Messages | Codementor

This tutorial helps you take a deeper look at the `WinMain` function to understand how structured a **Win32** application is. By the end of this tutorial, readers should be able to understand the concepts of message queues, window registration & creation,

www.codementor.io

 

 

Tutorial: Getting Started

Home Basics Getting Started A Simple Window Handling Messages The Message Loop Using Resources Menus and Icons Dialog Boxes Modeless Dialogs Standard Controls Dialog FAQ Creating a simple application Creating controls at runtime Files and the common dialog

winprog.org

 

'삽질 > COM' 카테고리의 다른 글

COM study note 5 레퍼런스 카운터  (0) 2020.10.28
COM study note 4 인터페이스  (0) 2020.10.27
COM study note 3 다이나믹 링킹  (0) 2020.10.27
COM study note 2 역사  (0) 2020.10.26
COM study note 1 소개  (0) 2020.10.26
복사했습니다!