调用DLL,被卡住了,求帮忙
自己写了C++程序 调用自己写的C++的dll 老是调用不起dll里面的方法。请大侠看看
调用dll程序:
#include "stdafx.h"
#include<iostream>
#include "windows.h"
typedef void(__stdcall *Print_)();
int main(){
HINSTANCE hDll; //DLL句柄
Print_ print_; //函数指针
hDll = LoadLibrary(L"C:/native.dll");
if (hDll != NULL)
{
printf("11111") ;
print_ = (Print_)GetProcAddress(hDll,"FunctionA");
if(print_!=NULL)
{
printf("22222") ;
print_();
}
FreeLibrary(hDll);
}
printf("33333") ;
return 0;
}
dll程序:
#include "stdafx.h"
#include<iostream>
using namespace std ;
void FunctionA()
{
printf("gogogogogog");
}
程序运行结果1111133333
2222 和gogogo都没显示
说明函数没掉出来 到底哪里有问题呢?