tags:

views:

201

answers:

1

Hey,

We have a .NET assembly (Aspose.Words actually) and we want clients to use it from COM clients without much hassle.

  1. So we ship a .TLB with the assembly so the client can use it from languages such as C++ or Delphi and don't bother extracting .TLB themselves.

  2. We also ship an .IDL with the assembly so the clients can look into it if they want to see the enumeration values if they are programming in ASP for example.

  3. I want .TLB and .IDL to be generated by a build script. I can generate .TLB no problems. But I cannot generate .IDL (or as an alternative convert .TLB to .IDL) in a command line. I do this manually using OLEVIEW.EXE which is not nice.

Heard about Delphi's TLIBIMP.EXE sounds like it could do that, but it does not seem to be available separately.

So the questions are:

  1. Anything from the above sounds stupid?

  2. How to get .IDL from a .NET assembly using a command line.

Thanks.

+1  A: 

The type library is sufficient for any language to use your server. The IDL would only be useful to generate a type library, which you already supply, or to generate a C++ header file, which is much easier to generate with the #import directive.

Which would be one way perhaps if you really want to do this, build a small C++ program that uses #import, provide the generated .tlh file.

Hans Passant
Thanks and I will seriously consider not supplying IDL.If you are programming say in VBScript/Perl/PHP/Python and not using an IDE with a TLB Object Browser, then .IDL allows to see how .NET exposed method signatures, for example RESULT Save_2([in] BSTR fileName); and enum values enum { HeightRule_AtLeast = 0, HeightRule_Exactly = 1, } HeightRule;But I guess there are not many developers out there doing this and if they are making their life so difficult already, they will be okay reading help how to convert TLB to IDL if needed.
romeok