C++创建动态库

【C++】创建动态库

有很多方法,这个只是其中一种 比较简洁的方法。


char* __stdcall correction(char* str)

char *_result = new char[search_word.length() + 1];
strcpy_s(_result,search_word.length() +1, search_word.c_str());
return _result;


typedef char* (__stdcall *fncorrection)(char* line);


HINSTANCE hdll;
hdll = LoadLibrary("D:\\vs_project1\\check\\Debug\\check.dll");
fncorrection myFun1;
myFun1 = (fncorrection)GetProcAddress(hdll, "correction");

posted @ 2018-09-28 14:56  amanda_zw  阅读(450)  评论(0编辑  收藏  举报