Error "E_UNEXPECTED(0x8000FFFF)" when using CDec/CInt/IsNumeric

Posted by Marc vB on Stack Overflow See other posts from Stack Overflow or by Marc vB
Published on 2010-03-31T07:43:41Z Indexed on 2010/03/31 7:53 UTC
Read the original article Hit count: 272

Filed under:

I have encountered a strange problem, which I could solve but don't understand why it did occur.

I have build a DLL with COM enabled. In this DLL I have classes that did use the functions CInt, CDec and IsNumeric. If I test these classes from a .NET application then it works ok. But when I called/run these classes from a Win32 application (with COM) then I did get an "E_UNEXPECTED(0x8000FFFF)" error.

After some debugging I found out that the problem would go away if I: - replaced IsNumeric with Integer.TryParse or Decimal.TryParse - replaced CInt with Integer.Parse - replaced CDec with Decimal.Parse

Can anyone explain this? Again, I could solve it by doing this but I would like to know why.

© Stack Overflow or respective owner

Related posts about vb.net