'DLLMain'에 해당되는 글 1건

  1. 2010.09.09 WinMain 과 DllMain
Programming/C Win32 MFC2010. 9. 9. 09:54
WinMain은 어플리케이션(독립 프로그램)의 ENTRY point 이고
DllMain은  Dll(라이브러리)의 ENTRY point 이다.

리눅스의 so 에서는 이런 ENTRY point가 없었는데, 먼가 생소한 느낌 -ㅁ-!

int CALLBACK WinMain(
  __in  HINSTANCE hInstance,
  __in  HINSTANCE hPrevInstance,
  __in  LPSTR lpCmdLine,
  __in  int nCmdShow
);

[링크 : http://msdn.microsoft.com/en-us/library/ms633559%28VS.85%29.aspx] WinMain

BOOL WINAPI DllMain(
  __in  HINSTANCE hinstDLL,
  __in  DWORD fdwReason,
  __in  LPVOID lpvReserved
);

[링크 : http://msdn.microsoft.com/en-us/library/ms682583%28VS.85%29.aspx] DllMain

Dll 역시 굳이 엔트리 포인트가 필요는 없으나, 단순한 함수의 모음이 아닌 특정 모듈로서의 Dll 이라
초기화가 필요하다면, 엔트리 포인트를 써야 한다고 한다.
[링크 : http://todayis.tistory.com/210]

그래도 역시 DllMain은 비어있는게 정석?!
[링크 : http://www.jiniya.net/tt/788]
Posted by 구차니