Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Fri Aug 08, 2008 5:34 pm   

[2.33 - 2.35] Windows created programmatically not loading properly
 
I have the following event that creates chat windows the first the package is loaded, and it works great the first time you run it.

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <event event="onLoad" priority="210" copy="yes">
    <value>#IF (@//CoreComm/firstRun == true) {
   $WindowList = "OOC|QA|IC|RL|Says|Direct"
   $System="Core-System"
   $pkgName="Company Issue - Chat"
 
  #mxp <FRAME action="open" Name=$System INTERNAL align="top" scrolling="yes" >
  #IF (%window( $System))  {#CALL %packages( $System, $pkgName)}
 
  #FORALL $WindowList  {
    $window=%concat(%char(34),%i,%char(34))
    #MXP
    #CALL %packages(%i,$pkgName)
  }
  firstRun=false
}
</value>
  </event>
</cmud>



The resulting XML windows look like this.

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<window name="Core-System" commandline="false" statusbar="false" dockalign="3" dockwith="0" left="0" top="0" width="300" height="200" host="-2" usesession="false" copy="yes">
  <uid>{F5B0B7E9-1CBF-4319-BF6F-3F4A2C5AF03F}</uid>
  <packages>Company Issue - Chat</packages>
</window>
<window name="Direct" commandline="false" statusbar="false" dockwith="4194545" left="0" top="0" width="300" height="200" host="-2" usesession="false" copy="yes">
  <uid>{63224F0E-1C89-468D-ABD6-64BF7CA92551}</uid>
  <packages>Company Issue - Chat</packages>
</window>
<window name="IC" commandline="false" statusbar="false" dockwith="4194545" left="0" top="0" width="300" height="200" host="-2" usesession="false" copy="yes">
  <uid>{11DB988D-BEFB-4E13-9737-8E59F0A842FA}</uid>
  <packages>Company Issue - Chat</packages>
</window>
<window name="OOC" commandline="false" statusbar="false" dockwith="4194545" left="0" top="0" width="300" height="200" host="-2" usesession="false" copy="yes">
  <uid>{2EEA7632-C471-484C-8566-1F72F58DB49A}</uid>
  <packages>Company Issue - Chat</packages>
</window>
<window name="QA" commandline="false" statusbar="false" dockwith="4194545" left="0" top="0" width="300" height="200" host="-2" usesession="false" copy="yes">
  <uid>{88D7CC14-C606-4FE4-9FBE-31B650769065}</uid>
  <packages>Company Issue - Chat</packages>
</window>
<window name="Says" commandline="false" statusbar="false" dockwith="4194545" left="0" top="0" width="300" height="200" host="-2" usesession="false" copy="yes">
  <uid>{78EFB21E-FFA8-4FED-BB03-8DC1F44C030E}</uid>
  <packages>Company Issue - Chat</packages>
</window>
<window name="RL" commandline="false" statusbar="false" dockwith="4194545" left="0" top="0" width="300" height="200" host="-2" usesession="false" copy="yes">
  <uid>{6259E88F-7F3C-431D-AA86-1FD458CD4423}</uid>
  <packages>Company Issue - Chat</packages>
</window>
</cmud>


The problem is that once you close and reopen the session the windows do not display properly. This occurs whether I create the windows with #MXP FRAME tag or the #MAKEWINDOW command. After closing and opening the sessions the xml for the windows looks like this.

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<window name="Core-System" dockalign="3" dockwith="0" left="0" top="0" width="300" height="200" host="-2" usesession="false" copy="yes">
  <uid>{F5B0B7E9-1CBF-4319-BF6F-3F4A2C5AF03F}</uid>
  <packages>Company Issue - Chat</packages>
</window>
<window name="Direct" dockwith="4194545" left="0" top="0" width="300" height="200" host="-2" usesession="false" copy="yes">
  <uid>{63224F0E-1C89-468D-ABD6-64BF7CA92551}</uid>
  <packages>Company Issue - Chat</packages>
</window>
<window name="IC" dockwith="4194545" left="0" top="0" width="300" height="200" host="-2" usesession="false" copy="yes">
  <uid>{11DB988D-BEFB-4E13-9737-8E59F0A842FA}</uid>
  <packages>Company Issue - Chat</packages>
</window>
<window name="OOC" dockwith="4194545" left="0" top="0" width="300" height="200" host="-2" usesession="false" copy="yes">
  <uid>{2EEA7632-C471-484C-8566-1F72F58DB49A}</uid>
  <packages>Company Issue - Chat</packages>
</window>
<window name="QA" dockwith="4194545" left="0" top="0" width="300" height="200" host="-2" usesession="false" copy="yes">
  <uid>{88D7CC14-C606-4FE4-9FBE-31B650769065}</uid>
  <packages>Company Issue - Chat</packages>
</window>
<window name="RL" dockwith="4194545" left="0" top="0" width="300" height="200" host="-2" usesession="false" copy="yes">
  <uid>{6259E88F-7F3C-431D-AA86-1FD458CD4423}</uid>
  <packages>Company Issue - Chat</packages>
</window>
<window name="Says" dockwith="4194545" left="0" top="0" width="300" height="200" host="-2" usesession="false" copy="yes">
  <uid>{78EFB21E-FFA8-4FED-BB03-8DC1F44C030E}</uid>
  <packages>Company Issue - Chat</packages>
</window>
</cmud>


The interesting thing is if I start the session holding the Shift key to reset the layout, the windows do get displayed albeit not with their original settings.

Zugg FYI, this is one I sent feedback back on in version 2.33 but the XML got truncated.

Another oddity is that what ever the bug is seems to also corrupt the tool bar in version 2.35, and causes an AV error when I try to reopen the session. I get and extra Prefs button on the Main Toolbar, (but it may have something to do with my code). If I close CMUD and reopen it, I don't get the AV but the extra button is still there. Resetting the toolbars seems gets rid of the extra button. I was not see the AV/extra tool bar button in version 2.33.

Here's the AV, I removed my personal info like email.

Code:
date/time         : 2008-08-07, 21:07:18, 625ms
operating system  : Windows XP Service Pack 2 build 2600
system language   : English
system up time    : 3 days 19 hours
program up time   : 16 minutes 27 seconds
processors        : 2x Genuine Intel(R) CPU T2600 @ 2.16GHz
physical memory   : 1048/2046 MB (free/total)
free disk space   : (C:) 14.18 GB
display mode      : 1600x1200, 32 bit
process id        : $d90
allocated memory  : 43.83 MB
executable        : cMUDPro.exe
exec. date/time   : 2008-07-31 17:16
version           : 2.35.0.0
compiled with     : BCB 2006/07
madExcept version : 3.0h
contact name      : Tech
callstack crc     : $f261231f, $36710003, $36710003
exception number  : 1
exception class   : EAccessViolation
exception message : Access violation at address 00D8B18F in module 'cMUDPro.exe'. Read of address 00000008.

Main ($2184):
00d8b18f +18b cMUDPro.exe  ToolbarDiff      125  +41 FindBar
00d8baca +1e6 cMUDPro.exe  ToolbarDiff      292  +27 LoadToolbarIni
00d8c269 +071 cMUDPro.exe  ToolbarDiff      391  +10 LoadToolbarDiff
00d86c55 +015 cMUDPro.exe  PARENT         11000   +1 TParentForm.LoadToolbar
00d86142 +3b2 cMUDPro.exe  PARENT         10640  +74 TParentForm.DoLoadLayout
00d7b9b3 +437 cMUDPro.exe  PARENT          4133  +56 TParentForm.NewMUD
00d77a0e +01a cMUDPro.exe  PARENT          2721   +2 MUDWindow
00d77ac6 +08e cMUDPro.exe  PARENT          2739  +14 TParentForm.CharAction
00d77b6e +006 cMUDPro.exe  PARENT          2765   +0 TParentForm.DoAction
004bf2cb +2bb cMUDPro.exe  Controls        5146  +83 TControl.WndProc
004c32cf +4fb cMUDPro.exe  Controls        7304 +111 TWinControl.WndProc
004a582f +553 cMUDPro.exe  Forms           3512 +136 TCustomForm.WndProc
00d1d4b8 +020 cMUDPro.exe  DXSounds        2128   +9 TCustomDXSound.FormWndProc
00d1ac5c +00c cMUDPro.exe  DXClass          635   +1 TControlSubClass.WndProc
004c29f8 +02c cMUDPro.exe  Controls        7073   +3 TWinControl.MainWndProc
0047c520 +014 cMUDPro.exe  Classes        11583   +8 StdWndProc
7e41f658 +016 USER32.dll                             CallWindowProcA
006d82cb +0a7 cMUDPro.exe  aqDockingUtils  1728   +7 CallDefWndProc
006d83b9 +0dd cMUDPro.exe  aqDockingUtils  1776  +41 TaqWindowEventFilter.WndProc
0047c520 +014 cMUDPro.exe  Classes        11583   +8 StdWndProc
7e4196c2 +00a USER32.dll                             DispatchMessageA
004ad9a4 +0fc cMUDPro.exe  Forms           8105  +23 TApplication.ProcessMessage
004ad9de +00a cMUDPro.exe  Forms           8124   +1 TApplication.HandleMessage
004adcd3 +0b3 cMUDPro.exe  Forms           8223  +20 TApplication.Run
00f08100 +088 cMUDPro.exe  cMUDPro          352  +20 initialization
7c91312f +069 ntdll.dll                              RtlUnicodeStringToAnsiString
7c812b94 +0b6 kernel32.dll                           GetVersionExA

error details:
Error when reopening session after generating windows.
_________________
Asati di tempari!

Last edited by Tech on Fri Aug 15, 2008 2:06 am; edited 1 time in total
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Aug 14, 2008 11:51 pm   
 
Looks like the forum must have messed up your #MXP command. I don't see the code to actually create the window. Can you condense this down to a simple test case using #MAKEWINDOW that I can try to test here?
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Fri Aug 15, 2008 2:07 am   
 
I just updated it, but just in case here it is.... I hope.

#MXP <FRAME action="open" Name=$window INTERNAL Align="tab" Dock=$System scrolling="yes" >
_________________
Asati di tempari!

Last edited by Tech on Thu Jul 30, 2009 5:41 am; edited 1 time in total
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Aug 15, 2008 3:01 am   
 
OK, sorry this didn't make it in 2.36, but it's still on the bug list for the next version.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net