先把创建好的DLL文件放到工程目录下,然后在相应的程序中导入。
代码如下:
typedef int (_cdecl *Connect)(int *i);
HINSTANCE hinst = NULL;
hinst = LoadLibrary(_T("MYDLL.dll"));
Connect Proc;
Proc = (Connect)GetProcAddress(hinst,"Add");
Proc(m_i);
FreeLibrary(hinst);
先把创建好的DLL文件放到工程目录下,然后在相应的程序中导入。
代码如下:
typedef int (_cdecl *Connect)(int *i);
HINSTANCE hinst = NULL;
hinst = LoadLibrary(_T("MYDLL.dll"));
Connect Proc;
Proc = (Connect)GetProcAddress(hinst,"Add");
Proc(m_i);
FreeLibrary(hinst);