Problem with Quit

This forum is for eXpress++ general support.
Post Reply
Message
Author
c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Problem with Quit

#1 Post by c-tec »

Hello,
I have a program that runs in the taskbar and opens an dialog window when needed. When this window is open and I logoff on my terminalserver, I get the message
Error BASE/1025
Parameter has a wrong data type
Quit
DC_GETLIST:EVENTLOOP(44449)
...


This is my code for the taskbar menu:

Code: Select all

LOCAL GetList[0], oMenu, aRef[2],oMenu1,oMenu2,oMenu3,oMenu4,oMenu5,oMenu6
//return .t.
if valtype(oTaskBar) = "O"
     piep(1)
     return .f.
endif

oTaskBar := TaskBarIcon():New( xbeP_User + 30 ):Create()
oTaskBar:AddIcon( 1, ICON_APP , "CT-PEN FormCommander" + Chr(13) + 'Rechts Click für das Menü' )
oFCSys:lStatTaskbar := .t.


DCSUBMENU oMenu PROMPT lmessage(1836,"Taskbar Menü") PARENT oTaskBar BARTEXT "FormCommander" OWNERDRAW BGCOLOR MENU_BARCOLOR BARFONT "10.Arial"
* 

    DCMENUITEM 'FormCommander'                       PARENT oMenu ACTION {||Thread():new():start({||formcommander()})}            BITMAP addpath(al_path,"\img\notes.gif") when 

DCREAD GUI PARENT oTaskBar EVAL {||aRef[1] := oMenu, aRef[2] := oTaskBar,formcommander()} HANDLER taskBarHandler REFERENCE @aRef
RETURN nil
I use vers 256

regards
Rudolf
Attachments
error1.jpg
error1.jpg (31.92 KiB) Viewed 11815 times
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: Problem with Quit

#2 Post by c-tec »

Hello Roger,
in dc_getbx.prg in line 4449
IF !oGetList:IsDesignOn .OR. oParentDlg == NIL .OR. oXbp == oParentDlg
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDIF

should this not be
IF !(oGetList:IsDesignOn .OR. oParentDlg == NIL .OR. oXbp == oParentDlg)
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: Problem with Quit

#3 Post by c-tec »

Hello Roger,
when I change it, then it works, but then pulldownmenues are no more working, strange
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Problem with Quit

#4 Post by rdonnay »

You are using build 255, not 256 because that would be the wrong line of code.
I don't know what is happening.
If you can give me a sample program that demonstrates the problem, then I can fix it for you.
If you cannot do that then put some debugging in the code as shown below.

Code: Select all

  IF Valtype(oXbp) == 'O'
    IF !oGetList:IsDesignOn .OR. oParentDlg == NIL .OR. oXbp == oParentDlg
wtl oXbp, nEvent, mp1, mp2  // <<<<<<<<<<<<< add this to write to debug.log
      oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDIF
  ELSE
    BREAK
  ENDIF
The eXpress train is coming - and it has more cars.

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: Problem with Quit

#5 Post by c-tec »

Hello Roger,
this is the debug info:
DC_XbpDialog1 1048633 0 1 <- Called From: DC_GETLIST:EVENTLOOP(4449), DC_GETLIST:READGUI(3677), DC_READGUI(101), FORMCOMMANDER(4008), (B)TASKBARMENU(954), DC_GETLIST:READGUI(3630), DC_READGUI(101), TASKBARMENU(954), PROG_START(615), PROGMAIN(132), MAIN(79), 16-06-2012 07:12:22

mp1 and mp2 ar no arrays in this case
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Problem with Quit

#6 Post by rdonnay »

The parameters look correct. I suspect that a memory corruption has occurred due to some bad C++ code in the Taskbar. I have never seen this problem before.

I suggest adding the following to _DCGETBX.PRG:

Code: Select all

  IF Valtype(oXbp) == 'O'
    IF !oGetList:IsDesignOn .OR. oParentDlg == NIL .OR. oXbp == oParentDlg
      IF nEvent == xbeP_Quit    // <<<<<<<<<<<<<<<<
         QUIT    // <<<<<<<<<<<<<<<
      ENDIF   // <<<<<<<<<<<<<<<
      oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDIF
  ELSE
    BREAK
  ENDIF
The eXpress train is coming - and it has more cars.

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: Problem with Quit

#7 Post by c-tec »

Hello Roger,
thank you, works now. Is this a failure in the Taskbar source ? Do you include this solutioin in the next version ?
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Problem with Quit

#8 Post by rdonnay »

Rudolf -

The taskbar source was donated by Thomas Braun in 2003.
I haven't worked in C in over 20 years and so I prefer not to try to figure out what's wrong in the code.

My best guess is that the workaround I gave you will solve your problem because it only seems to happen when quitting.

I will put this change in build 258.

Roger
The eXpress train is coming - and it has more cars.

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: Problem with Quit

#9 Post by c-tec »

Hello Roger,
many thanks, maybe somewhere we get another taskbar lib.
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

Post Reply