4

It seems there is no 64 bits version of tlbinf32.dll, this (old) COM DLL is used to extract informations of COM components. (see this SO answer )

I need to access it from a 64 bits C# application. I did not manage to host it into a separate surrogate process, I'm still obtaining the exception REGDB_E_CLASSNOTREG . My code works for x86 platforms but I have to implement it also for 64 bits.

Can any one help me by providing a step by step procedure to launch it into a surrogate (Dllhost) - or maybe another way to use it ?

Do you know a better alternative to browse trough all methods, classes.. of a native COM Dll ?

3
  • 1
    It is not very clear what you expect anybody here to do about it. Finding an alternative is not difficult, all of these interfaces are available in .NET in the System.Runtime.InteropServices.ComTypes namespace. The only extra thing you need is the pinvoke declaration of LoadTypeLib(). Commented Mar 3, 2017 at 2:21
  • I m trying to discover dynamically the methods, arguments, enumeration, class of a Com DLL. The tlbinf32.dll is very convenient to this end (see the SO answer mentioned above) , the System.Runtime.InteropServices.ComTypes namespaces semms much more cumbersome as I need to go trough all the IDispatch and to use IntPtr that need to be marshalled.
    – Malick
    Commented Mar 3, 2017 at 3:08
  • @Hans sorry the link to the API of tlbinf32.dll was wrong, I removed it.
    – Malick
    Commented Mar 3, 2017 at 3:10

1 Answer 1

13
  • open Windows' "Component Services"
  • open nodes to "My Computer/COM+ Applications"
  • right-click, choose to add a new Application
  • choose an "empty application", name it "tlbinf" for example
  • make sure you choose "Server application" (means it will be a surrogate that the wizard will be nice to help you create)
  • choose the user you want the server application to run as (for testing you can choose interactive user but this is an important decision to make)
  • you don't have to add any role, not any user
  • open this newly created app, right-click on "Components" and choose to add a new one
  • choose to install new component(s)
  • browse to your tlbinf32.dll location, press "Next" after the wizard has detected 3 interfaces to expose

That's it. You should see something like this:

enter image description here

Now you can use the same client code and it should work. Note the performance is not comparable however (out-of-process vs in-process).

The surrogate app you've just created has a lots of parameters you can reconfigure later on, with the same UI. You can also script or write code (C#, powershell, VBScript, etc.) to automate all the steps above.

3
  • Perfect, simple, effective and clear ! Does it work for all x86 native COM DLL that I need to call from x64 ?
    – Malick
    Commented Mar 3, 2017 at 15:04
  • 1
    @Malick - some DLL may not work (if they don't handle marshaling properly for example), but the principle is valid for all. Commented Mar 3, 2017 at 15:53
  • 1
    For VBA at least, this means CreateObject/ Dim As New TLIApplication will now use the 64bit COM+ application to make the object, so it should just work with no changes to code
    – Greedo
    Commented Jan 5, 2021 at 11:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.