Let me know how to use this "vbObjectError" in c# code: //This is my VB code
Public Enum CryptoErrors
ErrorAquiringContext = vbObjectError + 1056
ErrorCreatingHash = vbObjectError + 1057
ErrorCreatingHashData = vbObjectError + 1058
ErrorDerivingKey = vbObjectError + 1059
ErrorEncryptingData = vbObjectError + 1060
ErrorDecryptingData = vbObjectError + 1061
ErrorInvalidHexString = vbObjectError + 1062
ErrorMissingParameter = vbObjectError + 1063
ErrorBadEncryptionType = vbObjectError + 1064
End Enum
You could translate it literally as:
in which case you need a reference to Microsoft.VisualBasic.dll.
If you don't want to take a dependency on Microsoft.VisualBasic.dll, you could define your own C# constant instead:
But I'd question why you'd need it in a C# application. Constants offset from
vbObjectErrornormally correspond to an HRESULT and are used in a VBErr.Raisestatement.In C# you'd just throw an exception.