Import a lib file using visual studio

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?

+4
source share
4 answers

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 , .

1) ( ) projectproperties ( alt + f7).

Project properties

2) propertieslinker. general "Additional Library Directories".

Include dirs

3) input general lib "Additional Dependencies"

Additional Libs

+7

" ", 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.

+9

, Dll , ( , VS):

#pragma comment(lib, "path_to_lib\\libname.lib")

#import COM Dll

+2

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")
0
source

All Articles