Generating Interop with PreservSig attribute RRS feed

  • Question

  • I want a way to generate interop dll-s for com objects in a way that their methods signature has HRESULT return value. I know I should use PreserveSig attribute. But it is too difficult to change all the methods to the new signature.

    I checked options of TlbImp.exe and also TypeLibConverter class. But none of them support this approach. Is there any other tool to generate Interop dll-s in this way?
    Monday, January 5, 2009 2:59 PM


  • The source code for Tlbimp.exe has just recently been made available.  And it supports a new command line argument: /PreserveSig.  You're a lucky dude.

    Hans Passant.
    • Marked as answer by Reza J Thursday, January 8, 2009 11:15 AM
    Tuesday, January 6, 2009 1:37 AM