怎么调用DLL? 烦躁呀!!!我用VC写了一个DLL,但是在WIN32里怎么也调用不了。在VB里也不懂得调用。那一位帮忙一下,高分相送。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 先定义要调用的函数类型typedef int (WINAPI *PFNLIB)(void);注:此函数原型为:int fnLib(void);是dll中的导出函数app中调用此导出函数的代码HINSTANCE hMod = LoadLibrary( "lib.dll" );if( hMod ){ pfnLib = (PFNLIB)GetProcAddress( hMod, "fnLib" ); if( pfnLib ) { pfnLib(); // 此处就是调用dll中的函数 }} FreeLibrary( hMod ); See the samples below, FYI: http://www.codeproject.com/dll/dynamicdllloading.asphttp://www.codeproject.com/dll/dllease.asp u can find more samples via the link below :http://www.codeproject.com/dll 字符串格式化,求高手指教..... MFC中 怎么引用BitConverter类 如何将CString转换为浮点型 急!:将Dialog程序移至多文档程序中 DoDataExchange 如何做,如下 简单问题求助 弱弱地问一下:UTF-8、UTF-16 和 UNICODE 有什么区别? 请问 我的电脑 的进程 名是什么啊. DCOM 调用问题 有没有人知道DeviceIoControl的用法? 确定子窗口的大小和位置 将类放入dll中需要注意什么问题 ? ATL 菜菜问题 !
先定义要调用的函数类型
typedef int (WINAPI *PFNLIB)(void);
注:此函数原型为:int fnLib(void);是dll中的导出函数app中调用此导出函数的代码HINSTANCE hMod = LoadLibrary( "lib.dll" );
if( hMod )
{
pfnLib = (PFNLIB)GetProcAddress( hMod, "fnLib" );
if( pfnLib )
{
pfnLib(); // 此处就是调用dll中的函数
}
} FreeLibrary( hMod );
http://www.codeproject.com/dll/dllease.asp