C# HRESULT comparison

Posted by: Rick Strahls WebLog, on 19 Apr 2007 | View original

I just had a little brain freeze dealing with an HRESULT error from a COMException. When dealing with COM objects you still need to deal with the unfortunate COM idiosyncrasies like HRESULT values which get returned from just about every COM call. COMException exposes this HRESULT as an int value in the Exception's ErrorCode property. Now in my brain freeze haze I tried something like this: try{    this.OutputBuffer = this.ComInstance.GetType().InvokeMember("ProcessHit", BindingFlags.InvokeMethod,   ...

Advertisement
The leading UI suite for ASP.NET - Telerik radControls
Outstanding performance. Full ASP.NET AJAX support. Nearly codeless development.

Similar Posts

  • The power of generics compells you, the power of generics compells you... more
  • Pageflakes Releases Public Beta more
  • Comparisation of AJAX frameworks more
  • My Current Writing Queue more
  • FIX: Incorrect code is generated when you do an __int64 type data comparison in the debug build of a Visual C++ .NET application in Visual Studio .NET 2003 more
  • Rick at Southern Calfornia Fox User Groups this week more

News Categories

.NET | ADO.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Community Server | dasBlog | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD