Skip to content

COM interface return type incorrect #1250

Closed Answered by AArnott
lilhoser asked this question in Q&A
Discussion options

You must be logged in to vote

The signatures are not incorrect. They are simply declared in the default .NET interop mode where the HRESULT is hidden, and error codes are thrown in a COMException.

If you want to see the HRESULT return codes, you can opt into preservesig mode with a NativeMethods.json file like this:

{
  "$schema": "https://aka.ms/CsWin32.schema.json",
  "comInterop": {
    "preserveSigMethods": [
      "IAttachmentExecute"
    ]
  }
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AArnott
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants