编程语言
首页 > 编程语言> > 好烦啊,C++调用DLL一直失败

好烦啊,C++调用DLL一直失败

作者:互联网

 1 #include <iostream>
 2 #include <windows.h>
 3 
 4 /* run this program using the console pauser or add your own getch, system("pause") or input loop */
 5 
 6 typedef int (__stdcall *ptrSub)(int);
 7 
 8 HMODULE hm = LoadLibrary("111.dll");
 9 
10 int main() {
11     if(hm){
12         ptrSub ceshi=(ptrSub)GetProcAddress(hm,"kpf");
13         if(ceshi)
14         printf("%d\n",ceshi(9));
15     }else{
16         printf("dll加载失败\n");
17     }
18     FreeLibrary(hm);
19     return 0;
20 }

代码也没问题啊

标签:printf,int,ceshi,C++,DLL,好烦,ptrSub,hm,dll
来源: https://www.cnblogs.com/cutegirl/p/15367928.html