Inline... -----Original Message----- From: Andrew Hopper [mailto:[EMAIL PROTECTED]] Sent: Mittwoch, 9. Oktober 2002 17:03 To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Redeclaring COM interface return type - ??
Correct. Simply remove the PreserveSigAttribute, and the HRESULT will automatically be checked. An exception will be thrown when a failure HRESULT is returned. This is incredibly convenient, but there are occasionally methods that return S_FALSE instead of S_OK to indicate a "safe" failure, in which case you'll have to dust off good old PreserveSigAttribute in order to be able to inspect the result. *** SHIT. Sorry :-) There are components like this? GOD BEWARE :-) When there is an [out] parameter, you can simply use the out keyword. However, I'm guessing you really meant an [out, retval] parameter, in which case the retval parameter is treated as the return value of the method and is removed from the list of arguments. As an example, an IDL interface containing a method with a retval parameter translates from [ ... uuid("...") ... *** OK, so the trick is that was used to compile this has already the retval point. I just basically move one parameter (which? Any way to find this out without access to the ID`?) to the return type. *** Thanks. <...> For more detail, see "COM Interop Part 1: C# Client Tutorial" in the MSDN library. *** Yes, thanks :-) tel me I am a beginner here :-) No, really - thanks. Thomas Tomiczek THONA Consulting Ltd. (Microsoft MVP C#/.NET) You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.