你的程序开头加上#import "你的dll"
然后就可以用dll里的函数了

解决方案 »

  1.   

    有他的Dll和.h文件就行了,在程序中加入#import "x.dll" #include "x.h"就可用了.
      

  2.   

    提供调用Microsoft Office Type Library的调用代码
    仅供参考! 在StdAfx.h 中加入 #import "C:\Program Files\Common Files\Microsoft Shared\Office10\MSO.DLL" using namespace Office; 在程序初始化时加入
    CoInitialize(NULL); 在调用的程序中加入

    #include "msword.h"

    void CTestOleAutoDlg::OnButton1() 
    {
    _Application appWord;
    COleException e;
    IDispatch * pDisp = NULL;
    _CommandBarsPtr cmdBars = NULL;
    CommandBarControlsPtr cmdMenuFile = NULL; appWord.CreateDispatch(_T("Word.Application"), &e);
    appWord.SetVisible(TRUE);
    pDisp = appWord.GetCommandBars();
    pDisp->QueryInterface(__uuidof(_CommandBars), (void **)&cmdBars);
    pDisp->Release();
    long len = cmdBars->Count;
    cmdMenuFile = cmdBars->Item[_variant_t(L"File")]->Controls;
    cmdMenuFile->Item[_variant_t((long)1)]->Enabled = VARIANT_FALSE;
    }
      

  3.   

    如果你是控件,你可以使用MFCProject--->Add to Project--->Components and Controls...选择你要的控件,VC会帮你生成一堆类,它是从CWnd中继承的
    然后你使用Create方法就可以创建你的控件对象。