#import "Dnb3.dll" 
引用 vb编写的 DNB3.DLL
在此  
_Class8000 Ptc8000;
发生以下d3个错误 求教,怎样解决???
e:\program\vc\usevbdll\usevbdlldoc.h(21) : error C2146: syntax error : missing ';' before identifier 'Ptc8000'e:\program\vc\usevbdll\usevbdlldoc.h(21) : error C2501: '_Class8000' : missing storage-class or type specifierse:\program\vc\usevbdll\usevbdlldoc.h(21) : error C2501: 'Ptc8000' : missing storage-class or type specifiers

解决方案 »

  1.   

    包含头文件
    把dll相应的lib文件加入到工程里
      

  2.   

    usevbdlldoc.h缺某种类的说明,要包含需要的头文件。
      

  3.   

    用DEPENDS.EXE看dll导出的内容,确定无错
    用loadlibrary来导入dll。
      

  4.   

    有个参下:(详细http://blog.vckbase.com/jim97)
    4.vc引用vb中ocx和dll
        如 C:\TestVb\DBCommon.dll 是个vb做的数据库通用类。包括对表的操作。
          在vc中要同时引用 DBCommon.dll和msado15.dll
        a>stdafx.h 中加上
           #import "C:\Program Files\Common Files\System\Ado\msado15.dll" no_namespace      rename("EOF","adoEOF")
        #import "E:\backup\Recycled\Study\VB\vb_Report\DBCommon.dll" named_guids(不知道类名用默认,否则用no_namespace 类名) 
         
        b>在调用时先要在App中InitInstance 
           //初始化com类
          ::CoInitialize(NULL);          //用指定命名来定义类型接口指针
              ::DBCommon::_clsDBCommonPtr pdb;
        HRESULT hr=pdb.CreateInstance(DBCommon::CLSID_clsDBCommon);  
       if(FAILED(hr))
       {
                     AfxMessageBox("Active dll error",MB_ICONINFORMATION);
        return false;
       }
     
       pdb->PutDBPath(CurrentMoudlePath); //向类中传入数据库存路径
       pdb->PutDBPwd((_bstr_t)strpwd); //向类中传入数据库存密码
       BSTR bstrNo=_com_util::ConvertStringToBSTR(Mydata->Name.GetBuffer(0)); 
      // BSTR bstrNo=::SysAllocString(L"Q50001"); 
         hr=pdb->Qutation_Print_Transe(&bstrNo);//向类中传入报价单号
             
       
       pdb.Detach(); //free memory
      

  5.   

    jim97(木子)兄回答完全正确 昨天下午我已经自己搞定了谢谢大家 今天结帖