Dev 119

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

GRETA

MS의 research site에서 다운 받을수 있는 정규식(Regular Expression ) 라이브러리 이다. C++에서도 펄과 같은 정규식표현식이 필요할때 사용을 하면 된다. 물론 이것 말고 더 boost의 regex++ 라는 유명한 라이브러리도 있지만 regex++보다 가볍고 몇개의 소스로 배포 되어 있어서 사용하기에 더 편한것 같다. 그리고 regex++보다 낳은 성능을 주장(?)하고 있다 그렇지만 현재 적용중인 몇개의 소스는 regex++ 로 되어 있다 The GRETA Regular Expression Template Archive Fast backtracking regular expression engine. Separately compiled patterns. Matches agains..

Dev/C++ 2007.05.14

Why doesn't C++ provide a "finally" construct?

왜 C++에는 finally 키워드를 제공하지 않을까? #아마 java개발자라면 의문시 되는 질문일것이다. 반대로 C++개발자로서는 왜 java나 C# 같은언어에서 저런 키워드를 제공하고 있는것일까 의문이 들수도 있을것이다. Resource acquisition is initialization #Stroustrup의 해답은 C++에서는 "finally" 키워드 보다 낳은 테크닉인 RAII(resource acquisition is initialization)가 있기 때문이라는 것이다. RAII의 핵심은 소멸자에 있다 C++ 에서는 "finally"에서 해야할 동작(메모리, 리소스 해제..)을 각각의 객체의 소멸자에서 처리 할수 있기 때문에 오히려 더 OOP적인 아닌가 생각이 든다. 자기의 뒷처리(?)를 ..

Dev/C++ 2007.05.14