1. Mike Kochevar
  2. PowerBuilder
  3. Thursday, 3 December 2020 17:07 PM UTC

Hello,

I am in the process of moving a powerbuilder app from PB12.5 to PB2019. The migration was a success except for one error. When a user clicks on the Window option in the toolbar the app freezes and then eventually crashes. I have found this error in the Event Viewer...

 

Faulting application name: PB190.EXE, version: 19.1.0.2353, time stamp: 0x5f14536e
Faulting module name: KERNELBASE.dll, version: 10.0.17763.1613, time stamp: 0xa4105fac
Exception code: 0xc000041d
Fault offset: 0x001225f2
Faulting process id: 0xa78
Faulting application start time: 0x01d6c9953bcd00d9
Faulting application path: C:\Program Files (x86)\Appeon\PowerBuilder 19.0\PB190.EXE
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report Id: f04764c7-ee47-4f58-b581-7ccef2b0840a
Faulting package full name:
Faulting package-relative application ID:

 

Here is the code in the Selected() event for the Window option...

 

//////////////////////////////////////////////////////////////////////////////
//
// Event: selected
//
// Description:
// Enables menu items based on sheet manager service
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
// 6.0.01 Remove logic to disable menu items after windows have been minimized
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved.
// Any distribution of the PowerBuilder Foundation Classes (PFC)
// source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////

any la_rc
boolean lb_normal
integer li_rc
integer li_sheetcount
integer li_cnt = 1
arrangetypes le_arrange
n_cst_menu lnv_menu
window lw_obj
window lw_sheet[]
w_frame lw_frame

// Get frame window
li_rc = lnv_menu.of_GetMDIFrame (this, lw_obj)
if li_rc < 0 then
return
end if

// Determine if frame is a PFC frame descendant
la_rc = lw_obj.dynamic event pfc_descendant()
if IsNull (la_rc) then
return
end if
lw_frame = lw_obj

// If sheetmanager service is enabled, allow for undo and minimize capabilities
if IsValid (lw_frame.inv_sheetmanager) then

// First determine if there are any nonminimized sheets open
li_sheetcount = lw_frame.inv_sheetmanager.of_GetSheets (lw_sheet)
do while li_cnt <= li_sheetcount and not lb_normal
if lw_sheet[li_cnt].windowstate <> minimized! then
lb_normal = true
end if
li_cnt++
loop

this.m_undoarrange.enabled = true
this.m_minimizeall.enabled = lb_normal
this.m_cascade.enabled = lb_normal
this.m_layer.enabled = lb_normal
this.m_tilehorizontal.enabled = lb_normal
this.m_tilevertical.enabled = lb_normal

// Get current arrange state of windows and set undo text
le_arrange = lw_frame.inv_sheetmanager.of_GetCurrentState()
choose case le_arrange
case tile!
this.m_undoarrange.text = "&Undo Tile Vertical"
this.m_undoarrange.microhelp = "Undoes vertical tile arrangement of windows"
case tilehorizontal!
this.m_undoarrange.text = "&Undo Tile Horizontal"
this.m_undoarrange.microhelp = "Undoes horizontal tile arrangement of windows"
case cascade!
this.m_undoarrange.text = "&Undo Cascade"
this.m_undoarrange.microhelp = "Undoes cascaded arrangement of windows"
case layer!
this.m_undoarrange.text = "&Undo Layer"
this.m_undoarrange.microhelp = "Undoes layered arrangement of windows"
case icons!
this.m_undoarrange.text = "&Undo Minimize All"
this.m_undoarrange.microhelp = "Undoes minimization of windows"
case else
this.m_undoarrange.enabled = false
this.m_undoarrange.text = "&Undo"
this.m_undoarrange.microhelp = "Undo"
end choose
else
this.m_minimizeall.enabled = false
this.m_undoarrange.enabled = false
end if

When I debug through this event there is no crash but the menu does not display. 

Any help on this matter would be appreciated,

Thank you,

Mike

Govinda Lopez @Appeon Accepted Answer Pending Moderation
  1. Thursday, 3 December 2020 17:15 PM UTC
  2. PowerBuilder
  3. # 1

Hi Mike,

 

Have you tried doing a full rebuild of your project? Perhaps you might also want to optimize each library too. See if that does any difference.

 

 

Regards,

Comment
  1. Mike Kochevar
  2. Tuesday, 15 December 2020 15:07 PM UTC
Hi Chris,



Correct, the "Window" option on the toolbar is the only item with the problem all other toolbar items work without error.



The "Window" option is the only item with code in the "Selected" event. The option to navigate to the Ancestor script is unavailable.



Thanks,

Mike
  1. Helpful
  1. Mike Kochevar
  2. Tuesday, 15 December 2020 18:33 PM UTC
Sorry, the Window menu item (not toolbar item) is the only menu item with a problem all other menu items work without error.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 15 December 2020 20:12 PM UTC
Thought .... Once you select the top "Window" menu item and it drops, then as you move the mouse down to the Menu Item that you want - each menu item that the mouse hovvers over will get a "Selected" event. Could one of those menu items then be the culprit? This would not happen if you used the toolbar icon.
  1. Helpful
There are no comments made yet.
Stephan Schröpel Accepted Answer Pending Moderation
  1. Thursday, 3 December 2020 17:27 PM UTC
  2. PowerBuilder
  3. # 2

Have you checked the toolbar icons? Better use .png than .ico.

I had a crashing problem too and after I replaced one of the icons, it was running

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 3 December 2020 20:42 PM UTC
  2. PowerBuilder
  3. # 3

Hi Mike;

  Q: Did you change anything in the PB App under 2019 R2 after migration or is this happening right after a straight automatic WorkSpace / Target migration sequence?

Regards ... Chris

Comment
  1. Mike Kochevar
  2. Thursday, 3 December 2020 20:56 PM UTC
Hi Chris,



Thank you for your time. This is happening right after the migration.



Thanks, Mike
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 3 December 2020 21:40 PM UTC
Ahhhhh ... Yes, there was a few slight changes in the timing of events and firing order between PB 12.5.1, 12.5.2 and then 12.6. I seem to recall a slight change in that area as well in PB2017. So it could certainly be a related issue in the older PFC that did ( does not ) account for these changes. Especially, when POSTED events are also used.

Since changing the PFC layer may not an option from the sound of it, you might just have to persevere with your debugging efforts in order to resolve this.

BTW: Just a thought ... If you build an App EXE and run it with the /PBDEBUG option - does it work OK now?
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 15 December 2020 21:03 PM UTC
  2. PowerBuilder
  3. # 4

Hi, Mike - 

I think it's time to perform some experiments to try and determine the cause of the issue.

Here's how I would start:

In an empty "work" pbl, copy pfc_m_master and all menus descended from it. Then you have all of the potentially affected menus in one place where you can quickly and harmlessly change and regen them all. It might help to sketch out the menu ancestor/descendant hierarchy for regenerating purposes.

Comment out all of the code in the Selected event of m_window in pfc_m_master. Regen the menu objects in your work pbl in hierarchical order (pfc_m_master, direct descendants of pfc_m_master, then descendants of those descendants, etc.)

Test. If no more problem, you've isolated the offending code. and you can start un-commenting a few lines at a time, repeat until you find the line(s) causing the problem. If the same issue persists, REMOVE the code in that event, regen the same way, test. The goal here is to try and narrow down the cause of the issue you're experiencing.

Also look for descendant code in m_window's Selected event. I'm thinking this could be the problem, but this is a guess since I can't see your app's code.

Let us know what you find?

Regards, John

Comment
  1. Mike Kochevar
  2. Wednesday, 16 December 2020 19:35 PM UTC
Hi Chris,

The app uses a third party tool called CoolMenu in the constructor event of n_coolmenu a value is set to be pbvm190.dll if I change that value to point to pbvm125.dll the Window menu item works correctly. I do not know much about CoolMenu other than it is an old PB third party tool. From what I can tell there is not an upgrade.



I did use the suggestion you provided but I was unable to find any problems in the Selected event.



I am still looking at how to fix the problem.



Thank you for your time,

Mike
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 16 December 2020 20:36 PM UTC
Hi Mike;

Wow .. yes, I remember seeing and using the "Cool Menu" product. It was certainly "kool" in its day! ;-)

Unfortunately, the "Cool Menu" product is long EOL'ed. Not sure what to advise you from here. Hopefully a few other Cool Menu PB developers might be able to add some wisdom here.

BTW: Didn't Cool Menu use some external DLL's in its architecture?

Regards ... Chris
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 16 December 2020 20:35 PM UTC
  2. PowerBuilder
  3. # 5

Here's a link:

http://pbsite.milente.nl/coolmenu.html

It appears that n_coolmenu is an NVO that interfaces with a custom DLL. It was developed by Aart Onkenhout. I think it extracts menu bitmap image resources from the named PB dll, in this case PBVM125.dll.

My guess is when the icons in the PB IDE were upgraded recently, the resource ID's changed and the one(s) your app is requesting no longer exist in PBVM190.dll.

 

Comment
  1. Chris Pollach @Appeon
  2. Wednesday, 16 December 2020 20:42 PM UTC
Hi John ... I think that your your assessment of the issue is "spot on" (as David Peace would probably say) of this problem. The resource ID's have all changed for sure!

Regards ... Chris
  1. Helpful
  1. John Fauss
  2. Wednesday, 16 December 2020 21:11 PM UTC
Thanks, Crhis! Another point that Mike should consider is that if he intends to create a 64-bit version of his app, CoolMenu will not work since it is written, in part, as a 32-bit DLL. As you often say: Food for thought.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 16 December 2020 21:51 PM UTC
Yes .. another road block I am afraid. Hence always the danger in using 3rd party products in the long run. Especially ones that use external DLL's or rely on OCX components. Often these vendors do not keep up with technology (or goes out of business ) and then your PB Apps will hit a "brick wall" at some point-in-time. That is why my frameworks do not use 3rd party products or rely on 3rd party DLL's - only pure User Objects and PowerScript. I have a Tab Control user object that I wrote in PB 3.0 - before PowerSoft added the built-in Tab Control to PB later on - and It still works 100% even in PB 2019 R3 Beta. :-)
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.