fbpx
Welcome, Guest
Username: Password: Remember me
Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET
  • Page:
  • 1

TOPIC: Problem in Executable, but not from IDE

Problem in Executable, but not from IDE 07 Nov 2019 09:02 #11634

  • BiggyRat's Avatar

  • BiggyRat

  • Topic Author

    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?

    Attachments:

    Please Log in or Create an account to join the conversation.

    Last edit: by BiggyRat.

    Problem in Executable, but not from WED 07 Nov 2019 09:23 #11635

  • wriedmann's Avatar

  • wriedmann


  • Posts: 2232
  • 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

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    Problem in Executable, but not from WED 16 Nov 2019 13:33 #11743

  • BiggyRat's Avatar

  • BiggyRat

  • Topic Author

    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...

    Please Log in or Create an account to join the conversation.

    Last edit: by BiggyRat.

    Problem in Executable, but not from WED 16 Nov 2019 16:06 #11745

  • wriedmann's Avatar

  • wriedmann


  • Posts: 2232
  • Hi Jeff,

    can you give us an AEF from this application so we can try it?
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    Problem in Executable, but not from WED 17 Nov 2019 00:36 #11747

  • BiggyRat's Avatar

  • BiggyRat

  • Topic Author

    Certainly. Thanks very much Wolfgang.
    Attachments:

    Please Log in or Create an account to join the conversation.

    Last edit: by BiggyRat.

    Problem in Executable, but not from WED 17 Nov 2019 08:45 #11748

  • wriedmann's Avatar

  • wriedmann


  • Posts: 2232
  • 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

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    Problem in Executable, but not from WED 17 Nov 2019 09:07 #11749

  • BiggyRat's Avatar

  • BiggyRat

  • Topic Author

    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...

    Please Log in or Create an account to join the conversation.

    Last edit: by BiggyRat.

    Problem in Executable, but not from WED 17 Nov 2019 10:21 #11750

  • Karl-Heinz's Avatar

  • Karl-Heinz


  • Posts: 555
  • 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..

    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

    Please Log in or Create an account to join the conversation.

    Problem in Executable, but not from WED 17 Nov 2019 10:27 #11751

  • BiggyRat's Avatar

  • BiggyRat

  • Topic Author

    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...

    Please Log in or Create an account to join the conversation.

    Last edit: by BiggyRat.

    Problem in Executable, but not from WED 17 Nov 2019 10:57 #11752

  • Karl-Heinz's Avatar

  • Karl-Heinz


  • Posts: 555
  • Hi Jeff,

    ...
    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

    Please Log in or Create an account to join the conversation.

    Problem in Executable, but not from WED 17 Nov 2019 11:53 #11753

  • BiggyRat's Avatar

  • BiggyRat

  • Topic Author

    It's called clutching at straws Karl-Heinz :P I was experimenting and left it there thinking something was being left open and causing the problem

    Please Log in or Create an account to join the conversation.

    Last edit: by BiggyRat.

    Problem in Executable, but not from WED 20 Nov 2019 05:53 #11818

  • BiggyRat's Avatar

  • BiggyRat

  • Topic Author

    So, what was the solution Wolfgang?

    Please Log in or Create an account to join the conversation.

    Problem in Executable, but not from WED 20 Nov 2019 07:59 #11821

  • wriedmann's Avatar

  • wriedmann


  • Posts: 2232
  • Hi Jeff,
    I was not able to reproduce your issue because you had too included much libraries I don't use or even have.
    Removing the Report Classes don't changes anything?
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    Problem in Executable, but not from WED 20 Nov 2019 08:09 #11822

  • BiggyRat's Avatar

  • BiggyRat

  • Topic Author

    No Wolfgang. Made no difference at all. I'm at a total loss. Is it possible to write a Begin..End sequence to cover it?

    Please Log in or Create an account to join the conversation.

    Problem in Executable, but not from WED 20 Nov 2019 08:19 #11824

  • wriedmann's Avatar

  • wriedmann


  • Posts: 2232
  • Hi Jeff,
    I would add several DebOut() statements to discover where the exact point of failure is, starting the every line in the Start() method and then the called functions/methods.
    Do you have tried to compile your exe with "debug" set to on? Sometimes this gives better informations about runtime errors.
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    Problem in Executable, but not from IDE 20 Nov 2019 08:25 #11825

  • BiggyRat's Avatar

  • BiggyRat

  • Topic Author

    Ill try tge debout method, thank you Wolfgang. As for the debugger, it is already on...

    Please Log in or Create an account to join the conversation.

    Problem in Executable, but not from IDE 20 Nov 2019 08:27 #11826

  • wriedmann's Avatar

  • wriedmann


  • Posts: 2232
  • Hi Jeff,
    if you are not able to find anything, as last resort I could give a look on your development PC using TeamViewer or AnyDesk.
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    Problem in Executable, but not from IDE 20 Nov 2019 22:32 #11836

  • Jeff Stone's Avatar

  • Jeff Stone


  • Posts: 3
  • I haven't tried the IDE yet, so my following suggestion may be a waste of time. However, my experience with VC is that an uninitialized variable can cause a compile program to bomb while executing the same code in a debugger exhibits no problems as the debugger automatically initializes all variable..

    To find this kind of issue (and even if initialization is not the problem), I would put a bunch of messagebox() calls (messagebox("stop1"), messagebox("stop2"), messagebox("stop3")... into your compiled code. You can then narrow down the problematic code section by seeing in between which messagebox calls the code aborts. Then add more messagebox() calls in that area. Rinse and repeat.

    Good luck

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1