일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- E-P1
- 알고리즘
- mariadb
- GitHub
- imread
- CNN
- Splunk
- index
- dataframe
- keras
- ipad
- Python
- DFS
- GT-S80
- SPL
- RNN
- pip
- Lotto
- pandas
- mean
- Numpy
- LSTM
- install
- Button
- synology
- pycharm
- Series
- 삼성소프트웨어멤버십
- javascript
- SciPy
Archives
- Today
- Total
잠토의 잠망경
DllMain에서의 호출 순서 본문
DllMain.h
Dllmain.cpp
DllFunction.def
DllApp.cpp
#ifdef MYEXPORTDF #define MYEXPORT extern "C" __declspec(dllexport) #else #define MYEXPORT extern "C" __declspec(dllimport) #endif #undef UNICODE #include#include
Dllmain.cpp
#define MYEXPORTDF #include "DllMain.h" MYEXPORT int WINAPI wonJae() { printf("hi\n"); return 0; } BOOL WINAPI DllMain(HINSTANCE hInst, DWORD fdwReason, LPVOID lpRes) { switch (fdwReason) { case DLL_PROCESS_ATTACH: printf("Dll Process Attach\n");break; case DLL_PROCESS_DETACH: printf("Dll Process Detach\n"); break; case DLL_THREAD_ATTACH: printf("Dll Thread Attach\n"); break; case DLL_THREAD_DETACH: printf("Dll Thread Detach\n"); break; default: break; } return TRUE; }
DllFunction.def
LIBRARY "DllMain" EXPORTS wonJae
DllApp.cpp
#include "DllMain.h" typedef int (*fpu)(); int main(void) { printf("LoadLibrary Start\n"); HMODULE hModule=LoadLibrary("DllMain.dll"); printf("LoadLibrary End\n"); if(INVALID_HANDLE_VALUE == hModule) { printf("LoadLibrary error\n"); return 0; } printf("GetProcAddress Start\n"); fpu fPU=(fpu)GetProcAddress(hModule,"wonJae"); if(NULL == fPU) { printf("GetProcAddress error\n"); return 0; } printf("GetProcAddress End\n"); fPU(); printf("FreeLibrary Start\n"); FreeLibrary(hModule); printf("FreeLibrary End\n"); return 0; }
Comments