From: Rene J. Pajaron on 7 Jul 2010 22:45 Hi Richard, I cannot say if yours is easier, but I will try Geoff first and I will let you know. Rene On Jul 7, 6:30 pm, "richard.townsendrose" <richard.townsendr...(a)googlemail.com> wrote: > Rene > > in your shell window init() method put this > > // set up TDOC Error system > SELF:VOErrorBlock:=ErrorBlock({ | oErr | TDOCErrorHandler(oErr) }) > > then you need to catch it. we do two things > a) write an error log > b) place a message on screen and close ... try to force the user to > tell us... > > here's the code for the first bit - we close everything and "logout" > you can pass what you wabt to your "bug box". > > we have two levels - the bug box, and then the details in a textbox{} > > FUNCTION TDOCErrorHandler(oError AS Error) > LOCAL cText := '' AS STRING > LOCAL oBugBox AS BugDetail2 > LOCAL cErrMsg := '' AS STRING > LOCAL cErrLog := '' AS STRING > LOCAL aErrData AS ARRAY > > // back to vo error block > ErrorBlock({ | oErr | _Break(oErr) }) > > BEGIN SEQUENCE > > aErrData := TDOCWriteErrLog(oError) // writes err log file > cErrMsg:=aErrData[1] > cErrLog:=aErrData[2] > > oBugBox:=BugDetail2{SysObject(), {cErrLog, cErrMsg} }:Show() > > END SEQUENCE > > CloseLookups() > IF ! SysObject():Login == NULL_OBJECT > SysObject():Login:Logout(TRUE, cErrLog) > ENDIF > IF ! SysObject():Licence == NULL_OBJECT > SysObject():Licence:LogOut() > ENDIF > AdsApplicationExit() > QUIT > > RETURN NIL > > FUNCTION TDOCWriteErrLog(oError AS Error) AS ARRAY STRICT > LOCAL cPath := '' AS STRING > LOCAL cFile := '' AS STRING // ErrorLog > LOCAL cText := '' AS STRING > LOCAL siHandle := 0 AS PTR > LOCAL wi := 0 AS DWORD > LOCAL cEntity := '' AS STRING > LOCAL aArgs := {} AS ARRAY > LOCAL cErrorMsg := '' AS STRING > LOCAL liSize := 0 AS LONG > LOCAL uLine AS USUAL > > cPath := AllTrim(WorkDir()) > IF Right(cPath,1) <> '\' > cPath := cPath + '\' > ENDIF > cFile := cPath + 'T'+SubStr3(Time(),1,2)+SubStr3(Time(), > 4,2)+SubStr3(Time(),7,2)+'.ERR' > IF ! File(cFile) > siHandle := FCreate2(cFile,FC_NORMAL) > FClose(siHandle) > ENDIF > siHandle := FOpen2(cFile,FO_WRITE+FO_EXCLUSIVE) > FSeek3(siHandle,0L,FS_END) > > FWriteLine(siHandle,LoadResString('TDOC System > Information',IDG_TDOCSYSTEMINFORMATION,nPLH)) > FWriteLine(siHandle,LoadResString('Application',IDG_APPLICATION,nPLH) > +': '+SysObject():AppName) > FWriteLine(siHandle,LoadResString('Version',TG_VERSION,nPLH)+': > '+_TDOC_VERSION+"."+_TDOC_MAJORRELEASE+"."+_TDOC_MINORRELEASE) > FWriteLine(siHandle,LoadResString('User Name > Ref',IDG_USERNAMEREF,nPLH)+': '+ SysObject():GetSet(AppUser)) > FWriteLine(siHandle,LoadResString('Error File',IDG_ERRORFILE,nPLH)+': > '+cFile) > FWriteLine(siHandle,LoadResString('Date',ID_DATE,nPLH)+': > '+DToC(Today())) > FWriteLine(siHandle,LoadResString('Time',ID_TIME,nPLH)+': '+Time()) > FWriteLine(siHandle,LoadResString('Windows > Version',IDG_WINDOWSVERSION,nPLH)+': '+WinVersionInfo()) > //FWriteLine(siHandle,'Ext Error: '+GetExtError()) > FWriteLine(siHandle,'Data Set: ' + > SysObject():GetSet(DataPath)) > > FWriteLine(siHandle,'') > FWriteLine(siHandle,LoadResString('TDOC Where-in-Program > Information',IDG_TDOCWHEREINPROGRAM,nPLH)) > // > 123456789012345678901234567890123456789012345678901234567890 > FWriteLine(siHandle,'Module Entity > Line No') > wi := 0 > cEntity := STRING(ProcName(wi)) > DO WHILE ! Empty(cEntity) > cText := PadR(STRING(ProcFile(wi)),20) > cText := cText + PadR(cEntity,28) > uLine := ProcLine(wi) > IF uLine <> NIL > cText := cText + PadL(NTrim(uLine),4) > ENDIF > FWriteLine(siHandle,cText) > wi:=wi + 1 > cEntity := STRING(ProcName(wI)) > ENDDO > > FWriteLine(siHandle,'') > FWriteLine(siHandle,LoadResString('Error > Detail',IDG_ERRORDETAIL,nPLH)) > FWriteLine(siHandle,'Arg: '+oError:Arg) > FWriteLine(siHandle,'ArgNum: '+NTrim(oError:ArgNum)) > aArgs := oError:Args > FOR wI := 1 UPTO ALen(aArgs) > FWriteLine(siHandle,'Args: '+Str(wI,3)+AsString(aArgs[wI]) > +' : '+TypeString(UsualType(aArgs[wI]))) > NEXT > FWriteLine(siHandle,'ArgType: '+TypeString(oError:ArgType)) > FWriteLine(siHandle,'ArgTypeReq: > '+TypeString(oError:ArgTypeReq)) > FWriteLine(siHandle,'CallFuncSym: > '+Symbol2String(oError:CallFuncSym)) > FWriteLine(siHandle,'CanDefault: '+AsString(oError:CanDefault)) > FWriteLine(siHandle,'CanRetry: '+AsString(oError:CanRetry)) > FWriteLine(siHandle,'CanSubstitute: > '+AsString(oError:CanSubstitute)) > FWriteLine(siHandle,'Description: '+oError:Description) > FWriteLine(siHandle,'FileHandle: '+NTrim(oError:FileHandle)) > FWriteLine(siHandle,'FileName: '+oError:FileName) > FWriteLine(siHandle,'FuncPtr: '+AsString(oError:FuncPtr)) > FWriteLine(siHandle,'FuncSym: > '+Symbol2String(oError:FuncSym)) > FWriteLine(siHandle,'GenCode: '+ErrString(oError:GenCode)) > FWriteLine(siHandle,'MaxSize: '+NTrim(oError:MaxSize)) > FWriteLine(siHandle,'MethodSelf: '+AsString(oError:MethodSelf)) > FWriteLine(siHandle,'Operation: '+oError:Operation) > FWriteLine(siHandle,'OsCode: '+NTrim(oError:OsCode)+' : > '+DosErrString(oError:OsCode)) > IF oError:Severity == ES_CATASTROPHIC > FWriteLine(siHandle,'Severity: CATASTROPHIC') > ELSEIF oError:Severity == ES_ERROR > FWriteLine(siHandle,'Severity: ERROR') > ELSEIF oError:Severity == ES_WARNING > FWriteLine(siHandle,'Severity: WARNING') > ENDIF > FWriteLine(siHandle,'SubCode: '+NTrim(oError:SubCode)) > FWriteLine(siHandle,'SubCodeText: '+oError:SubCodeText) > FWriteLine(siHandle,'SubstituteType: > '+TypeString(oError:SubstituteType)) > FWriteLine(siHandle,'SubSystem: '+oError:SubSystem) > FWriteLine(siHandle,'Tries: '+NTrim(oError:Tries)) > > FWriteLine(siHandle,'') > FWriteLine(siHandle,LoadResString('TDOC User Status > Information',IDG_TDOCUSERSTATUSINFO,nPLH)) > FWriteLine(siHandle,'ACTIVATION: > '+NTrim(Memory(MEMORY_ACTIVATION))) > FWriteLine(siHandle,'CLASSCOUNT: > '+NTrim(Memory(MEMORY_CLASSCOUNT))) > FWriteLine(siHandle,'COLLECT: > '+NTrim(Memory(MEMORY_COLLECT))) > FWriteLine(siHandle,'COLLECTCOUNT: > '+NTrim(Memory(MEMORY_COLLECTCOUNT))) > FWriteLine(siHandle,'CS: > '+NTrim(Memory(MEMORY_CS))) > FWriteLine(siHandle,'CS_SIZE: > '+NTrim(Memory(MEMORY_CS_SIZE))) > FWriteLine(siHandle,'DB_DS: > '+NTrim(Memory(MEMORY_DB_DS))) > FWriteLine(siHandle,'DB_DS_SIZE: > '+NTrim(Memory(MEMORY_DB_DS_SIZE))) > FWriteLine(siHandle,'DS: > '+NTrim(Memory(MEMORY_DS))) > FWriteLine(siHandle,'DS_SIZE: > '+NTrim(Memory(MEMORY_DS_SIZE))) > FWriteLine(siHandle,'DYNINFOFREE: > '+NTrim(Memory(MEMORY_DYNINFOFREE))) > FWriteLine(siHandle,'DYNINFOMAX: > '+NTrim(Memory(MEMORY_DYNINFOMAX))) > FWriteLine(siHandle,'DYNINFOSIZE: > '+NTrim(Memory(MEMORY_DYNINFOSIZE))) > FWriteLine(siHandle,'DYNINFOUSED: > '+NTrim(Memory(MEMORY_DYNINFOUSED))) > FWriteLine(siHandle,'FUNCTIONCOUNT: > '+NTrim(Memory(MEMORY_FUNCTIONCOUNT))) > FWriteLine(siHandle,'GLOBALSEL: > '+NTrim(Memory(MEMORY_GLOBALSEL))) > FWriteLine(siHandle,'MAXATOM: > '+NTrim(Memory(MEMORY_MAXATOM))) > FWriteLine(siHandle,'MEMTOTAL: > '+NTrim(Memory(MEMORY_MEMTOTAL))) > FWriteLine(siHandle,'PRIVAT: > '+NTrim(Memory(MEMORY_PRIVAT))) > FWriteLine(siHandle,'PUBLIC: > '+NTrim(Memory(MEMORY_PUBLIC))) > FWriteLine(siHandle,'REGCOLLNOTIFYEND_COUNT: > '+NTrim(Memory(MEMORY_REGCOLLNOTIFYEND_COUNT))) > FWriteLine(siHandle,'REGCOLLNOTIFYSTART_COUNT: > '+NTrim(Memory(MEMORY_REGCOLLNOTIFYSTART_COUNT))) > FWriteLine(siHandle,'REGISTERAXIT: > '+NTrim(Memory(MEMORY_REGISTERAXIT))) > FWriteLine(siHandle,'REGISTEREXIT_COUNT: > '+NTrim(Memory(MEMORY_REGISTEREXIT_COUNT))) > FWriteLine(siHandle,'REGISTERKID: > '+NTrim(Memory(MEMORY_REGISTERKID))) > FWriteLine(siHandle,'RT_DGROUP: > '+NTrim(Memory(MEMORY_RT_DGROUP))) > FWriteLine(siHandle,'RT_DS: > '+NTrim(Memory(MEMORY_RT_DS))) > FWriteLine(siHandle,'SEQUENCE: > '+NTrim(Memory(MEMORY_SEQUENCE))) > FWriteLine(siHandle,'SP: > '+NTrim(Memory(MEMORY_SP))) > FWriteLine(siHandle,'SS: > '+NTrim(Memory(MEMORY_SS))) > FWriteLine(siHandle,'STACK_FREE: > '+NTrim(Memory(MEMORY_STACK_FREE))) > FWriteLine(siHandle,'STACK_SIZE: > '+NTrim(Memory(MEMORY_STACK_SIZE))) > FWriteLine(siHandle,'STACKKID: > '+NTrim(Memory(MEMORY_STACKKID))) > FWriteLine(siHandle,'SYSTEM_FREE: > '+NTrim(Memory(MEMORY_SYSTEM_FREE))) > FWriteLine(siHandle,'SYSTEM_MAX: > '+NTrim(Memory(MEMORY_SYSTEM_MAX))) > FWriteLine(siHandle,'WINDOWS_SYSTEMRESOURCES: > '+NTrim(Memory(MEMORY_WINDOWS_SYSTEMRESOURCES))) > FWriteLine(siHandle,'WINDOWS_GDIRESOURCES: > '+NTrim(Memory(MEMORY_WINDOWS_GDIRESOURCES))) > FWriteLine(siHandle,'WINDOWS_SYSTEMRESOURCES: > '+NTrim(Memory(MEMORY_WINDOWS_USERRESOURCES))) > > liSize := FTell(siHandle) > liSize := IIF(liSize > 64000,64000,liSize) > > cErrorMsg := Space(DWORD(liSize)) > > FCommit(siHandle) > FClose(siHandle) > > siHandle:= FOpen2(cFile, FO_READ+FO_SHARED) > cErrorMsg:= FReadStr(siHandle, DWORD(liSize)) > > FClose(siHandle) > > RETURN {cErrorMsg, cFile} > > hope that easier than using geoff's stuff .. > > apologies geoff > > richard
From: Rene J. Pajaron on 7 Jul 2010 22:50 Hi Martens, This is ok if you have tens of users. But with hundreds and going to thousands.... Anyway, when you do that, do you erase the VOERROR.log? Otherwise, you will received lots of garbage. BTW: Sometime, I cannot see VOERROR.log in Windows 7. My program is installed at Program Files\App_Name, and have experienced some problems when LOG files get hidden under "COMPATIBILITY files". I have this problem with InnoSetup fail to see Program Files\My_App \MYApp.INI at installation. Regards Rene On Jul 7, 8:05 pm, John Martens <adsl672...(a)tiscali.nl> wrote: > Rene, > > I just check for teh VO error file at startup and if it is there I mail > it to me. > Most of the times this gives me enough clues what to fix. > > Cheers, > John > > Op 6-7-2010 15:05, Rene J. Pajaron schreef: > > > Hello, > > > I read it somewhere that there is VO error management system that > > replaces VO built-in error log. I would like to make my users and > > field support staff alike well-informed and undo some confusion that > > about what is runtime error window is and error/info boxes that I used > > to display warnings and information. > > > Built-in routines for email (and SMS?), that would be great. > > > I am using VO2.8 SP3. > > > Thanks in advance. > > > Regards, > > > Rene > >
From: Stephen Quinn on 7 Jul 2010 23:18 Rene > My program is installed at Program Files\App_Name, and have Wrong place to install it from what I've read elsewhere. Most USERS have limited, if any access rights in Program Files under Vista/Windows 7. CYA Steve
From: John Martens on 8 Jul 2010 01:37 Rene, I send the error at next startup and then delete it. Hopefully for you you do not get lots of error files. Cheers, John Op 8-7-2010 4:50, Rene J. Pajaron schreef: > Hi Martens, > > This is ok if you have tens of users. But with hundreds and going to > thousands.... > > Anyway, when you do that, do you erase the VOERROR.log? > > Otherwise, you will received lots of garbage. > > BTW: Sometime, I cannot see VOERROR.log in Windows 7. > My program is installed at Program Files\App_Name, and have > experienced some problems when LOG files get hidden under > "COMPATIBILITY files". > > I have this problem with InnoSetup fail to see Program Files\My_App > \MYApp.INI at installation. > > Regards > > Rene > > On Jul 7, 8:05 pm, John Martens<adsl672...(a)tiscali.nl> wrote: >> Rene, >> >> I just check for teh VO error file at startup and if it is there I mail >> it to me. >> Most of the times this gives me enough clues what to fix. >> >> Cheers, >> John >> >> Op 6-7-2010 15:05, Rene J. Pajaron schreef: >> >>> Hello, >> >>> I read it somewhere that there is VO error management system that >>> replaces VO built-in error log. I would like to make my users and >>> field support staff alike well-informed and undo some confusion that >>> about what is runtime error window is and error/info boxes that I used >>> to display warnings and information. >> >>> Built-in routines for email (and SMS?), that would be great. >> >>> I am using VO2.8 SP3. >> >>> Thanks in advance. >> >>> Regards, >> >>> Rene >> >> >
From: John Martens on 8 Jul 2010 01:35 I think since Vista when you try to wrtie to Program Files\App_Name and you have no write access it will be writen to AllUsers/MyUser/AppData/Roaming My VoError.log is always in the data folder where the user must have write access. John Op 8-7-2010 5:18, Stephen Quinn schreef: > Rene > >> My program is installed at Program Files\App_Name, and have > > Wrong place to install it from what I've read elsewhere. > Most USERS have limited, if any access rights in Program Files under > Vista/Windows 7. > > CYA > Steve > >
First
|
Prev
|
Pages: 1 2 Prev: Problems connecting to SQL Server Express Next: help help help... invalid record header.. |