Problem in Executable, but not from IDE

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
Anonymous

Problem in Executable, but not from IDE

Post by Anonymous »

I get the following error sometimes when using my program as an .exe. The same code runs fine without any problem when run from within the VO WED. Any ideas where I even start to look please?
Capture.JPG
Capture.JPG (21.97 KiB) Viewed 422 times
User avatar
wriedmann
Posts: 3668
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Problem in Executable, but not from WED

Post by wriedmann »

Hi Jeff,
please check the opened DLLs.
The exe may be started from another location than from the IDE.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
BiggyRat

Problem in Executable, but not from WED

Post by BiggyRat »

Hi Wolfgang, I've been all over the program, got rid of absolutely everything that isn't needed, even removed everything fron the start() method except the initialize, and exec statements, and it still happens. All I need to do is start the program, and hit the exit button. Do nothing else, and 95% of the time the error occurs.

Does this give anyone any clues?

Start Method()

method Start() class App
local oMainWindow as ShellWindow
Local cWorkDir, cPath as String
Local cHelpFile := WorkDir() +"; "+ WorkDir()+"Invoices" + "; "+ WorkDir()+"BizHelp" as String
VODBRddSetDefault("DBFCDX")
cWorkDir := WorkDir()
cPath := cWorkDir +"; "+ cWorkDir+"Invoices" + "; "+ cWorkDir+"BizHelp"
SetPath(cPath)
SetNatDLL("BRITISH")
SetDateCountry ( BRITISH )
SetDateFormat("dd/MM/yyyy")
SetCentury(true)
SetAmPm(false)
SetThemeAppProperties(_or(STAP_ALLOW_NONCLIENT, STAP_ALLOW_CONTROLS, STAP_ALLOW_WEBCONTENT))
SetExclusive(FALSE)
SetDeleted(true)
self:SetGlobalValues()
Run("FixOutlook2016.reg")
self:Initialize()
oMainWindow := ShellWindow{self}
oMainWindow:Caption := cAppVersion
oMainWindow:Icon := BM{}
oMainWindow:IconSm := BM{}
oMainWindow:EnableSystemMenu(FALSE)
oMainWindow:HelpDisplay := HelpDisplay{"BizMan.CHM" }
oMainWindow:HelpDisplay:EnableHTMLHelp(true)
SetInternational(#Clipper)
oMainWindow:Show(SHOWZOOMED)
MainMenu{}:Show(SHOWCENTERED)
self:Exec()

Return self



Exit Button.

METHOD ExitButton( ) CLASS MainMenu
Local oTb as TextBox
Local oDb as DBServer
oDb := DbServer{"BACKUPS"}
oDb:SetOrder("BACKUPS", "BACKUPS")
oDb:GoTop()
IF !oDb:Seek(Today()-7)
oTb := TextBox{self, cAppVersion, "It appears your last backup was over 7 days ago. Would you like to backup now?"}
oTb:TYPE := BOXICONQUESTIONMARK + BUTTONYESNO

IF (oTb:Show() = BOXREPLYYES)
self:BackUpButton()
ENDIF
endif
oDb:Close()
Close All
oTb := TextBox{self, cAppVersion, "Do you really want to quit?"}

oTb:TYPE := BOXICONQUESTIONMARK + BUTTONYESNO

IF (oTb:Show() = BOXREPLYYES)
self:Destroy()
App{}:Quit()
ENDIF
return self


Note, this error was playing up well before any mention of BACKUP, which I only implemented today...


Thanks again for any light you may be able to shed...
User avatar
wriedmann
Posts: 3668
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Problem in Executable, but not from WED

Post by wriedmann »

Hi Jeff,

can you give us an AEF from this application so we can try it?
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
BiggyRat

Problem in Executable, but not from WED

Post by BiggyRat »

Certainly. Thanks very much Wolfgang.
Attachments
Business Manager 1.60c 17-11-2019.zip
(812.75 KiB) Downloaded 36 times
User avatar
wriedmann
Posts: 3668
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Problem in Executable, but not from WED

Post by wriedmann »

Hi Jeff,
I had to remove a LOT of code to make compile the code on my system, since you had a lot of libraries included.
But now the application compiles and runs on my PC, both from the IDE and the Exe itself.
Do you are really using the old Report Classes (based on CA-RET)?
In my machine the relative DLLs are missing, so I think they are not even delivered with VO 2.8.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
BiggyRat

Problem in Executable, but not from WED

Post by BiggyRat »

Hi Wolfgang, no I've never used ca-ret, only ever ReportPro. What am I linking in that involves ca-ret? Report classes I'm assuming. I've removed it. and it's still happening. this time took 7 open and closes...
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

Problem in Executable, but not from WED

Post by Karl-Heinz »

Hi Jeff,

a note about your ExitButton() code:

Line: App{}:Quit()
Are you aware of that you create a *new* App Object ? Use GetAppObject() as described below instead..

Code: Select all

METHOD ExitButton( ) CLASS MainMenu

...     			
...

oTb := TextBox{self, cAppVersion, "Do you really want to quit?"}

oTb:TYPE := BOXICONQUESTIONMARK + BUTTONYESNO

IF (oTb:Show() = BOXREPLYYES)

//	self:Destroy()                 // <-------deactivate the line

//	App{}:Quit()			// <------deactivate the line

	GetAppObject():Quit()          // <---- add this line 
	
ENDIF
return self

regards
Karl-Heinz
BiggyRat

Problem in Executable, but not from WED

Post by BiggyRat »

Now that's very interesting, thank you Karl-Heinz. I did think that was the case, but I just followed the help files and old habits.

I've implemented the change, but sadly it still played up...
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

Problem in Executable, but not from WED

Post by Karl-Heinz »

Hi Jeff,

Code: Select all

...
oDb:Close()
Close All      // <-------??? ------------
oTb := TextBox{self, cAppVersion, "Do you really want to quit?"}
---
why do you need the "Close All" ? This command will always be executed, regardless of whether the app should shut down or not ?

regards
Karl-Heinz
Post Reply