CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Question About TLB files

  1. #1
    Join Date
    Jun 2006

    Question About TLB files

    Hi all,
    Coming back to CG forums after a long time. I am currently refreshing my past dev experience using the interop article at:
    I have D/L the sample code from the article. In first sample in \..\COMClassic directory, there is a ATL COM project called AirlineInformation and it generates AirlineInformation.tlb file. I am running everything on Windows 7 OS / Visual Studio 2008 and earlier on I got an error PRJxxxx which was related to insufficient rights. So I ran VS with admin privileges and got rid of that error. I was able to successfully build the project. However, it does not generate any tlb. I have a tlb that came with the source code download. So I removed the existing tlb from the current location and rebuild the project. Now it generated a tlb. But when I run tlbimp.exe to import the tlb file contents to a dll as metadata to expose it to .NET, some how it does not find it. I migrated the entire VS solution from VS 8 to VS 2008. I also checked the MIDL output directory in the properties for the project and it is ./debug. But the tlb is created only in top level folder with the solution and not in the \debug.
    My Questions:
    Why do I not get a new tlb in ./debug folder?
    Why does tlbimp not recognize the tlb file?
    How to run a program like tlbimp as an admin from command prompt if at all that is the problem?
    Did the migration of the project that was developed in VC++6 to 2008 need any more fixes?

  2. #2
    Join Date
    Oct 2002
    Timisoara, Romania

    Re: Question About TLB files

    You probably don't get a new tlb if one already exists, because there was no change to the project that should trigger a new rebuild. Try modifying the IDL and see if you still don't get a new tlb.

    Does tlbimp return some error? Are you sure you called it with the right parameters?

    You can run tlbimp As administrator from a console by running the console As Administrator.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  3. #3
    Join Date
    Jun 2006

    Re: Question About TLB files

    Thanks Cilu. Tried that. The error message is:
    TlbImp : error T10000 : Unable to locate input type library: 'C:\Users\USER\Documents\Visual'
    I dunt know what that means. I had no problems running tlbimp or any .NET tool on Windows XP or 2003. One thing to note here is...the path is not a complete path. Why is the error message showing incomplete path? The complete path to tlb is as under:
    C:\Users\USER\Documents\Visual Studio 2008\Projects\COMInteropWithDOTNET\COMInteropWithDOTNETSource\ClassicCOM\AirlineInformation
    Are spaces in Visual Studio 2008 directory name creating problem?
    Let me know...

  4. #4
    Join Date
    Jun 2010

    Re: Question About TLB files

    File paths containing spaces could always lead to problems when entered (improperly) on the command line. That's neither specific to any Windows version nor any VS version.

    Enclose the file path in double quotes when invoking TlbImp.
    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)