Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use and call a function in a .tlb file?

Status
Not open for further replies.

korntex5

Programmer
Feb 14, 2005
2
FR
Hi i want translate two lines VB in C# code to use my .tlb

VB code:

Set MesMacroAuto = CreateObject("Packbuilder.ApiPack")
MesMacroAuto.Show

any idea?


 
Set a COM reference in your project to the Packbuilder object.

Right-click on References in your solution pane, click "Add", and go to the COM tab.

This will do a early-binding. If you want to do a late-binding, you'll need to do several things:

1) Use tlbimp.exe to create a COM-Callable Wrapper from your .tlb file.

2) Create a co-class using the ComImport attribute, and put it in it's own assembly.

3) You can then use the System.Activator to load it dynamically at runtime.

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
thanks it's work. I work on delphi 2005 with C# IDE and i had seen that if you add the .tlb to your project it's work too but your .tlb is not refenced in frame work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top