c调用dll中的函数

留作自己日后翻查

#include
#include
typedef void (*MYPROC)(char*);
int main()
{
HINSTANCE LibHandle;
MYPROC ProcAdd;
char dllbuf[] = "C:\\DEV-CPP\\workspace\\helloDll\\helloDll.dll";
char sysbuf[] = "HelloWorld"; /*过程名*/
char *cmdbuf = ""; /*过程要带入的参数*/
LibHandle = LoadLibrary(dllbuf); /*载入dll*/
ProcAdd = (MYPROC)GetProcAddress(LibHandle, sysbuf); /*获取函数sysbuf的地址*/
(ProcAdd)(cmdbuf); /*ProcAdd就相当于函数 show123*/
}

你可能感兴趣的:(资料库)