views:

959

answers:

1

Currently I am using the statement:

 #import "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\test.tlb" named_guids

But I am getting the folder path programatically. i.e., "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727"

I have to load test.tlb from this path which resides in a variable say, folderpath. I have to import the tlb programatically by concatenating folderpath+test.tlb. How can I do this?

A: 

You can specify the prog ID instead if this helps, for example:

#import "progid:Outlook.Application" named_guids

This beats using a hard-coded path.

Rob
How can i exactly do this. suppose my c# namespace is TestNmand interface is ITest class is SqlClass finally myy tlb is Test.tlbthen #import "progid:Test.tlb" is correct...
Cute
#import "Guid:35145a33-e434-49dc-92cf-e056c508525a" named_guids i tried like this. But it shows can not open the lobrary "Guid:35145a33-e434-49dc-92cf-e056c508525a" no such type of library
Cute
It may be Helpful if u answer my comment..
Cute
i tried #import "progid:Test.SqlClass" but got errors plz observehttp://stackoverflow.com/questions/1195353/how-to-import-a-tlb-using-the-progid
Cute