By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,231 Members | 1,333 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,231 IT Pros & Developers. It's quick & easy.

HResult in c#

P: n/a
Hi,
In our application we reference com components written in c++.When errors
occur the messages appear like this

'Exception from HRESULT: 0xC0068002"

is there a way to convert this HResult value string (0xC0068002) and convert
it into an int value

thanks in advance
Manoj Nair
Nov 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
The exception being thrown is of the Type, "System.Runtime.InteropServices.COMException".

Your Try...Catch blocks should be explicitly catching this type of exception when calling unmanaged functions.
The class has a property, "ErrorCode" that returns the HResult as an int.

--
Dave Sexton
dave@www..jwaonline..com
-----------------------------------------------------------------------
"Manoj" <mn*********@hotmail.com> wrote in message news:eR**************@TK2MSFTNGP12.phx.gbl...
Hi,
In our application we reference com components written in c++.When errors
occur the messages appear like this

'Exception from HRESULT: 0xC0068002"

is there a way to convert this HResult value string (0xC0068002) and convert
it into an int value

thanks in advance
Manoj Nair

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.