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 / 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:34 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
Nicholas Paldino [.NET/C# MVP] - 26 Oct 2007 15:39 GMT
Adam,

   I don't believe you can.  The tlh and tli files are auto-generated based
on the type-library definition and are not meant to be provided by you.

   Even if you were able to import the tlh and tli files, that wouldn't
prevent you from needing to use the type library, as it would be needed to
be registered in order for your C++ app to use the .NET components.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> 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 - 12 lines]
> Cheers
> Adam Bryant

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.