码迷,mamicode.com
首页 > 编程语言 > 详细

c++builder调用dll

时间:2015-11-17 10:49:19      阅读:176      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!