代碼如下
#import "CConvert.dll" no_namespace
CConvert.dll存放在工程目錄下、Debug檔案夾和Release檔案夾里面(總之就是我能復制的地方我都復制到了),但是就是持續出現錯誤。
C1083 無法打開型別庫檔案: “c:\users\公用-請及時添加自己的微軟賬戶\documents\visual studio 2015\projects\運動會服務器\運動會服務器(win32)\cconvert.dll”: 加載型別庫/DLL 時出錯。
c:\users\公用-請及時添加自己的微軟賬戶\documents\visual studio 2015\projects\運動會服務器\運動會服務器(win32)\里面確實有cconvert.dll啊怎么辦。。。
uj5u.com熱心網友回復:
現在的情況是,所有的dll都import不了!!大神求幫助!!!uj5u.com熱心網友回復:
挪到非C盤上的非漢字且不帶空格的檔案夾下再試試?The #import Directive
C++ Specific
The #import directive is used to incorporate information from a type library. The content of the type library is converted into C++ classes, mostly describing the COM interfaces.
Syntax
#import "filename" [attributes]
#import <filename> [attributes]
attributes:
attribute1, attribute2, ...
attribute1 attribute2 ...
filename is the name of the file containing the type library information. A file can be one of the following types:
a type library (.TLB or .ODL) file
an executable (.EXE) file
a library (.DLL) file containing a type library resource (such as .OCX)
a compound document holding a type library
any other file format that can be understood by the LoadTypeLib API
The filename is optionally preceded by a directory specification. The filename must name an existing file. The difference between the two forms is the order in which the preprocessor searches for the type library files when the path is incompletely specified.
Syntax Form Action
Quoted form This form instructs the preprocessor to first look for type library files in the same directory of the file that contains the #import statement, and then in the directories of whatever files that include (#include) that file. The preprocessor then searches along the paths shown below.
Angle-bracket form This form instructs the preprocessor to search for type library files along the paths shown below.
The compiler will search in the following directories for the named file:
the PATH environment variable path list
the LIB environment variable path list
the path specified by the /I (additional include directories) compiler option
#import can optionally include one or more attributes. These attributes tell the compiler to modify the contents of the type-library headers. A backslash (\) symbol can be used to include additional lines in a single #import statement. For example:
#import “test.lib” no_namespace \
rename(“OldName”, “NewName”)
uj5u.com熱心網友回復:
用絕對路徑寫到C盤根目錄試試uj5u.com熱心網友回復:
專案-》屬性-》聯結器-》輸入-》依賴性 添加VC++目錄里面 庫目錄 添加路徑
uj5u.com熱心網友回復:
vs2015就沒安裝成功過,vs2013就挺好uj5u.com熱心網友回復:
你這個dll是否為vs2015版本編譯的com組件轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/112568.html
標籤:進程/線程/DLL
上一篇:請教獲取旺旺訊息視窗句柄的問題
