Tech Off Thread

4 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Why does tlbimp.exe work but direct reference from VS2008 not work on some COM components?

Back to Forum: Tech Off
  • User profile image
    pompomJuice

    I have this dll that I presume is a COM component. ( anyone that can give me any pointers as to how I would determine if a .dll is indeed a valid COM component? )


    The reason I ask is there seems to be something going on that I am not fully aware of. I have a project that directly references some COM objects. It works fine on my box, but other developers ( using SVN to get the source ) get an error "not a valid asssembly or COM component" error when they try to add the respective COM component to the project. 

    Interestingly I got two COM components from the SDK. One works on my machine fine, but the other fails to load with the same error that the other developers get when trying to load any one of the two. tlbimp.exe does make an assembly though. 

    What is going on?

    Regards

  • User profile image
    pdev

    It sounds like you might have a type library problem.  To add the com component they'll have to have the corrisponding tbl and register it with regtlib.exe or regtlibv12.exe.

    Hope that helps

  • User profile image
    pompomJuice

    pdev said:
    It sounds like you might have a type library problem.  To add the com component they'll have to have the corrisponding tbl and register it with regtlib.exe or regtlibv12.exe.

    Hope that helps
    That was genius.

    It worked!!!!

    I was googling all day and found nothing. Thanks a lot I would never have figure this out, partly to the fact that it seems like a random fix. 

    I googled that exe but I dont find much info on it. Where can I find more info on why there was an error and why this worked?

    Thanks again.


  • User profile image
    pdev

    pompomJuice said:
    pdev said:
    *snip*
    That was genius.

    It worked!!!!

    I was googling all day and found nothing. Thanks a lot I would never have figure this out, partly to the fact that it seems like a random fix. 

    I googled that exe but I dont find much info on it. Where can I find more info on why there was an error and why this worked?

    Thanks again.


    Ah cool, I'm glad that worked for you.  So the tools use to come with .Net 2.0, but it appears they're not shipped with .Net 3.5.  I'm not sure why they're no longer shipped, but you got it to work without them so no worries.  It probably looking in the relative directory and found the tbl itself, so there was no need to register it.

    So why did this work?  Type Libraries are binary files that define how you communicate with a COM object.  Typically the type library is embedded into the object itself, but sometimes it's not.  In your case I assume found the tbl on your computer so there were no issues, but on the remote machines it was missing and Visual Studio simply didn't have the information it needed to use the object.

    kyle

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.