전체 글 300

DLL 파일 찾는 순서

1. The directory from which the application loaded. 2. The current directory. 3. The system directory. Use the GetSystemDirectory function to get the path of this directory. 4. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory. 5. The directories that are listed in the PATH environment variable. -- LoadLibrary혹은 DLL을 동적링크할때 특정경로에 관계없이 응용프로그램의 디렉토리에서 먼저..

Dev/Windows 2007.05.14

DLL export

1. 첫번째 방법 __declspec(dllexport) 키워드를 사용한다. 이경우 calling convention이 "__cdecl" 이면 함수이름 그대로 export되지만 calling convention이 윈도우 표준인 "__stdcall" 이면 함수이름규칙이 변한다 [msdn] __stdcall Name-decoration convention An underscore (_) is prefixed to the name. The name is followed by the at sign (@) followed by the number of bytes (in decimal) in the argument list. Therefore, the function declared as int func( int ..

Dev/Windows 2007.05.14

_beginthread, _beginthreadex

Create a thread. unsigned long _beginthread( void( __cdecl *start_address )( void * ), unsigned stack_size, void *arglist ); unsigned long _beginthreadex( void *security, unsigned stack_size, unsigned ( __stdcall *start_address )( void * ), void *arglist, unsigned initflag, unsigned *thrdaddr ); C-Run time 라이브러리를 지원하는 Thread 생성함수들이다. C-Run time 라이브러리를 지원한다는 뜻은 Thread내에서 C-Run time 함수를 사용했을경우 함수의..

Dev/Windows 2007.05.14