--- tags: c/c++, dll --- # DLL 1. dll 可以export出function,(然後其他專案只要load dll就能使用這個function) ![](https://i.imgur.com/ZLeGmtg.png) ``` #ifdef __DLL_EXPORT #define DLLEXPORT __declspec(dllexport) #else #define DLLEXPORT #endif #ifdef __cplusplus extern "C" { #endif ``` 2. 實作部分 ![](https://i.imgur.com/gJ9NjvE.png) AFX_MANAGE_STATE(AfxGetStaticModuleState()) 為mfc架構 or msdn特有 3. 使用方式 c# ![](https://i.imgur.com/LInhqOJ.png) msdn ![](https://i.imgur.com/TdrhznI.png)