Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use tlb files in a native C++ project

I have a tlb files that contains some function declaration that I need to use.

If I use

#import "type_library.tlb"

I can correclty reference the function from my code:

tlb_namespace::required_function();

But when I compile the project the linker says that tlb_namespace::required_function is an unresolved external symbol.

How can I succesfully build this kind of project?

EDIT:

I have used the same type library in a Dummy VBA access project. I have added the reference to the type library and I have noticed that some of the function contained in the type library are correctly called. But some of them are not. VBA says It can't locate their entry point in the related dll.

Can this explain the unresolved external symbol when building c++ app?

I have also noticed that the failing function are declared in the tlb like this:

UPPER_function_name

but in the dll are declared like this:

Upper_function_name

Can this be the issue?

Is it possible to solve this kind of error directly modifying the binary tlb file or dll?

like image 672
sblandin Avatar asked Mar 13 '13 09:03

sblandin


1 Answers

Use IDE to view TLB information.
Use this help : How to: View Type Library Information

At IDE : View-> Object Browser, click "..." Edit Custom Component Set, browse your TLB file and Add to view information.

Confirm namespace used for.

like image 195
lsalamon Avatar answered Oct 29 '22 17:10

lsalamon