首页 > 编程语言 > 详细

c++builder调用dll

时间:2015-11-17 10:46:59      阅读:215      评论:0      收藏:0      [点我收藏+]

c++builder调用dll

// 定义
typedef int __stdcall MyFunction (int x, char *str);

int rtn = 0;
String dllName = "XXXX.dll";
HINSTANCE hInstance = LoadLibrary(dllName.c_str());
MyFunction * pMyFunction = (MyFunction*) GetProcAddress(hInstance, "rdcompany"); // 函数名称要正确
if (pMyFunction == NULL)
{
// 提示
}

rtn = pMyFunction(1, "aa");
FreeLibrary(hInstance);
hInstance = NULL;

 

c++builder调用dll

原文:http://www.cnblogs.com/cb168/p/4970764.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!