DLL装载成功,却找不到所需函数,请教了!
#include <windows.h>
#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
return 1;
}
extern _declspec(dllexport)double mytest();
double mytest()
{
return 100.0;
}
DLL头文件:
#ifndef MyDllH
#define MyDllH
extern "C" _declspec(dllexport) double mytest();
#endif
外部程序调用代码:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
HINSTANCE h;
FARPROC cv;
h=LoadLibrary("mydll");
if(h)
{
MessageBox(NULL,"成功装载MYDLL","成功",0);
cv=(FARPROC)GetProcAddress(h,"mytest");
if(cv)
{
MessageBox(NULL,"成功找到函数","成功",0);
double aa=cv();
Label1->Caption =AnsiString(aa);
}
else MessageBox(NULL,"找不到函数","失败",0);
FreeLibrary (h);
}
}
相关推荐
由于找不到iUtils.dll,无法继续执行代码
该工具用于解决以下问题:对应文章教程:http://t.csdn.cn/S0Hkj 由于找不到iUtils.dll,无法继续执行代码。重新安装程序可能会解决此问题。 修复成功率100%,不会操作的可以通过联系我远程帮你解决哦。
C++中找不到DLL入口点的解决办法
C++中找不到DLL入口点的解决办法C++中找不到DLL入口点的解决办法
彻底解决vcruntime140.dll找不到的问题
彻底解决vcruntime140.dll找不到的问题,安装VC++5015 X64或X86 自行选择安装!!!
ImportError: DLL load failed: 找不到指定的模块。
ImportError: DLL load failed: 找不到指定的模块。 … During handling of the above exception, another exception occurred: Traceback (most recent call last): File “******”, line 1, in import tensorflow as tf File “E:\Anaconda3\lib\site-packages\tensorflow_init_.py”, line 101, in from tensorflow_core import * F
解决windows上安装tensorflow时报错,“DLL load failed: 找不到指定的模块”的问题
主要介绍了解决windows上安装tensorflow时报错,“DLL load failed: 找不到指定的模块”的问题,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下


Windows SDK/API
