Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / October 2007

Tip: Looking for answers? Try searching our database.

Generate tlh/tli from a tlb?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Skirmish - 26 Oct 2007 08:33 GMT
Long story short: I've been able to load a C# dll in C++ by having the
C# project generating a type library (tlb) and #importing that in C+
+.  The #import directive looks like a compiler shortcut that
generates a tlh and tli locally.  Now what I want to be able to do is
generate the tlh and tli somehow and include them directly in my C++
project, thus doing away with the need for the #import statement.

I've looked at the MIDL.exe help but couldn't see a way to do this.  I
also tried using a new C++ project that simply #imports the tlb with
the hope that I could specify where the tlh and tli get generated, but
I couldn't see a setting for that.

Any help would be appreciated.

Cheers
Adam Bryant
Carl Daniel [VC++ MVP] - 26 Oct 2007 15:28 GMT
> Long story short: I've been able to load a C# dll in C++ by having the
> C# project generating a type library (tlb) and #importing that in C+
[quoted text clipped - 7 lines]
> the hope that I could specify where the tlh and tli get generated, but
> I couldn't see a setting for that.

You've pretty much summed up the situation: #import is a compiler tool that
builds a .tlh/.tli from a .tlb and there's no way to specify where the
resulting files should be placed.  The best you can do is to create a simple
C++ project that #imports your .tlb and then copy the .tlh/.tli from the
"intermediate files" directory of the project (typically %PROJECTDIR%\Debug
or %PROJECTDIR%\Release) to a common include directory.

-cd

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.