老师给了一个头文件和一个dll文件,要求编程调用dll文件中的函数。但是我把dll文件导出到def文件,发现接口不对。我的问题是:要解读该dll文件需要什么方面的书籍???
下面是该头文件的一部分:
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 5.01.0164 */
/* at Tue Jul 16 11:29:38 2002
*/
/* Compiler settings for F:\work\work2002\FRIOCOM\FRIOCOM.idl:
Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
error checks: allocation ref bounds_check enum stub_data
*/
//@@MIDL_FILE_HEADING( )
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 440
#endif#include "rpc.h"
#include "rpcndr.h"#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/#ifndef __FRIOCOM_h__
...........
下面是该头文件的一部分:
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 5.01.0164 */
/* at Tue Jul 16 11:29:38 2002
*/
/* Compiler settings for F:\work\work2002\FRIOCOM\FRIOCOM.idl:
Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
error checks: allocation ref bounds_check enum stub_data
*/
//@@MIDL_FILE_HEADING( )
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 440
#endif#include "rpc.h"
#include "rpcndr.h"#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/#ifndef __FRIOCOM_h__
...........
解决方案 »
- listbox在单击某项的函数里处理//可以让前俩项失去焦点,把焦点落到第三项上?
- 用过VS2008sp1和VS2010的朋友请进
- 麻烦高手指点怎么用WINDOWS API编写一个带菜单的空窗口
- 计时器????
- 求助:怎样才能在任意时候关闭整个程序啊?
- COM数据库组件:在IDL文件中定义枚举类型遇到的问题
- 急啊!!!不同标签页的内容如何显示???
- 一個關于窗口移動的問題?
- 关于文件监控
- 500强知名企业招聘3D应用程序开发工程师,工作地点上海
- SDK对话框上静态文本透明的问题!
- 有谁用vc+symbain sdk开发过手机程序,vc6一定要装update3吗?那里有update3的下载,我在ms的网站上没找到!
在头文件中声明
//DLL接口函数
extern "C" __declspec(dllexport) void DBLoadCreateWizard();//这些都是你想调用的函数
在.cpp.文件中实现函数
extern "C" __declspec(dllexport) void DBLoadCreateWizard()
{ //实现代码
}
在你调用老师的动态链接库的地方按写如下方式写代码:
HINSTANCE hDll;
CString LinkPath; //动态链接库的地址
LinkPath=gl_sPath+"\\SPLSERVER.dll"; //拼接动态链接库的地址
hDll = LoadLibrary(LinkPath);//找到动态链接库文件
if(hDll!=NULL)
{ // 调用老师的函数 }