I am trying to import a file as shown below:
#import "francais.dll"
He tells me that he cannot open the source file "C: /xxxx/Proj/Release/francais.tlh"
The library file exists in Proj.
How to solve this?
You need to add .lib to the project properties. Do you have .lib to go with the DLL? Another question related to a similar problem can be found here: How to use a third-party DLL file in Visual Studio C ++?
, , .lib, DLL. , , - DLL , . DLL Windows , .
.lib
1) ( ) project → properties ( alt + f7).
project
properties
2) properties → linker. general "Additional Library Directories".
linker
general
"Additional Library Directories"
3) input general lib "Additional Dependencies"
input
"Additional Dependencies"
" ", COM-. #import .tli .tlh , francais.dll. , .tlh , , - DLL. . , , .
. OleView.exe Visual Studio File + View Typelib, DLL. , IDL.
VS, File + Open + File DLL. , DLL, node "TYPELIB" 1, . - , #import .
, , Release. Debug.
, Dll , ( , VS):
#pragma comment(lib, "path_to_lib\\libname.lib")
#import COM Dll
#import
I had similar problems with the MSO.DLL COM server (MS Office 14/2010) in Visual Studio 2015.
IntelliSense warning (red) disappears after the first build / compilation! My real problem was the exact path. I had to write it by hand. Copy / paste vom Explorer not working.
#import "C:\Program Files\Common Files\microsoft shared\OFFICE14\MSO.DLL" no_implementation rename("RGB", "ExclRGB") rename("DocumentProperties", "ExclDocumentProperties") rename("SearchPath", "ExclSearchPath")