Error handling strucErrInfo
Posted: Thu Apr 28, 2022 6:07 am
I am working on the conversion of a large VO system to X#. I did not create it and am a newbie to VO, but have much experience in other languages, including in the .NET environment.
I seem to be able to sort most things with the help files and the other X# support, but I am a bit stalled with this one, even after digging around for a while. The following code is from an error reporting routine in our app. It gets passed an error in oError and, the way I read it, it checks to see that oError is in fact an error object, if not it generates an error about that.
IF !(IsInstanceOf(oError, #ERROR))
ClearstrucErrInfo()
strucErrInfo.dwGenCode := EG_WRONGCLASS
strucErrInfo.dwSeverity := ES_ERROR
strucErrInfo.symFuncSym := #DefError
strucErrInfo.pszArg := AsPsz(oError)
strucErrInfo.dwArgNum := 1
strucErrInfo.lCanDefault := .T.
oError := ErrorBuild(@strucErrInfo)
ENDIF
The compiler complains that it does not know two identifiers strucErrInfo and ClearstrucErrInfo. From my research they seem to be from a global error handling feature in VO. It may be that I just need the correct reference to an assembly, but have not found that. It may need to be redone in some newer way.
Can anyone direct me to a solution?
Incidentally I would like to complement the X# team on what they have produced. It is a fine piece of work.
Best Regards,
John Bonnett
I seem to be able to sort most things with the help files and the other X# support, but I am a bit stalled with this one, even after digging around for a while. The following code is from an error reporting routine in our app. It gets passed an error in oError and, the way I read it, it checks to see that oError is in fact an error object, if not it generates an error about that.
IF !(IsInstanceOf(oError, #ERROR))
ClearstrucErrInfo()
strucErrInfo.dwGenCode := EG_WRONGCLASS
strucErrInfo.dwSeverity := ES_ERROR
strucErrInfo.symFuncSym := #DefError
strucErrInfo.pszArg := AsPsz(oError)
strucErrInfo.dwArgNum := 1
strucErrInfo.lCanDefault := .T.
oError := ErrorBuild(@strucErrInfo)
ENDIF
The compiler complains that it does not know two identifiers strucErrInfo and ClearstrucErrInfo. From my research they seem to be from a global error handling feature in VO. It may be that I just need the correct reference to an assembly, but have not found that. It may need to be redone in some newer way.
Can anyone direct me to a solution?
Incidentally I would like to complement the X# team on what they have produced. It is a fine piece of work.
Best Regards,
John Bonnett