.h includes the declaration of your function....
.lib includes the output function information ect...
.dll includes the code(bindary, can be executed.)

解决方案 »

  1.   

    谢谢,可是我想了解一下到底什么时候需要include .h,什么时候需要import的?
      

  2.   

    #import 是 VC 的专用预处理指令,他根据 ActiveX(.DLL)控件中的类型库生成包装类。.h 是类,函数,常量,类型,外部变量声明的地方,使用 #include 包含的原文件中。.dll 是动态连接库,可以包含函数,类,控件的实现代码(已编译).lib 是静态连接库,或者是动态连接库的引入库,存放函数、类等的实现(静态连接库)或 实现的 存根/代理 (动态连接库的引入库)。
      

  3.   

    include (lib,h,dll)
    typedef int (FAR PASCAL * LPFN)(DWORD , DWORD );
    AfxLoadLibrary
    GetProcAddress
    -----------------------------------
    import(tlb,dll)
    CoCreateInstance
    GetHwndAndMsghandle
      

  4.   

    http://www.csdn.net/expert/topic/624/624448.xml?temp=.125683
      

  5.   

    你最好还是试着编一个DLL
    然后用一下就用明白的
      

  6.   

    我的意思是根据你工程的需要,应用dll的方式也不同。
    比如自己的dll,一般有.h,.lib,.dll,.def等文件,可以尝试用
    各种不同的方式来调用。
    如:
    在使用了
    #import "your.tlb" raw_interfaces_only, no_namespace, named_guids
    之后,用:
    HRESULT hrt=CoCreateInstance(CLSIDyour,NULL,
                            CLSCTX_INPROC_SERVER,
    IID_Iyours,
    reinterpret_cast<void**>(&pyours));
    再使用pyours->yourfunc();
    当然也可以用#include "your.h"的方式进行调用。
      

  7.   

    1.lib导出函数的列表,他标示了到处函数在动态库中的位置,程序编译时使用。
    2。.h市导出函数的申明。
    3。dll是导出函数所在的位置,运行时使用。
    明白了吗?