老师给了一个头文件和一个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__
...........

解决方案 »

  1.   

    在工程中加入该dll,并包含该头文件就可以用这些函数了
      

  2.   

    在老师的动态链接库中声明你所想要调用的函数。例如:
    在头文件中声明
    //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)
    {                      // 调用老师的函数                     }