1. Barry Ellison
  2. PowerBuilder
  3. Friday, 22 December 2023 02:49 AM UTC

Under normal situations my right-click looks like this.

The following crash occurs in either runtime or EXE. 2019 R3 build 2728.  When focus is set to the desktop and without setting focus back to the application, we immediately right-click on the datawindow hoping for the 'Update' menu.  Instead we get an app-crash.  Once I found the offending line (lm_info.m_list.popmenu()), I wrapped a try/catch block around it in hopes of catching something but got nothing.  Both lm_info and lm_info.m_list are valid based on logging.

Via another thread I found mention of pbresource.dll and pbsysfunc.dll need to be deployed.  These are indeed deployed in my EXE folder which is also in my path.  It also mentions removing any image from the menu toolbar, of which there are none.  https://community.appeon.com/index.php/qna/q-a/pb-2019-r3-crashes-on-context-menus-with-menuimage

Try
	// Popup menu
	gnv_app.inv_logging.of_log( 'u_tabpg_client_desk_info: dw_1.rbuttondown before popmenu() - Frame X and Y = ('+string(lw_parent.pointerx())+','+string(lw_parent.pointery())+')')
	If IsValid(lm_info) Then
		gnv_app.inv_logging.of_log( 'u_tabpg_client_desk_info: dw_1.rbuttondown before popmenu() - lm_info is valid')
		If IsValid(lm_info.m_list) Then
			gnv_app.inv_logging.of_log( 'u_tabpg_client_desk_info: dw_1.rbuttondown before popmenu() - lm_info.m_list is valid')
		Else
			gnv_app.inv_logging.of_log( 'u_tabpg_client_desk_info: dw_1.rbuttondown before popmenu() - lm_info.m_list is invalid')
		End If
	Else
		gnv_app.inv_logging.of_log( 'u_tabpg_client_desk_info: dw_1.rbuttondown before popmenu() - lm_info is invalid')
	End If
	lm_info.m_list.PopMenu (lw_parent.PointerX() + 5, lw_parent.PointerY() + 10)
Catch (Throwable T1)
	gnv_app.inv_logging.of_log( 'could not popmenu - throwable msg follows')
	gnv_app.inv_logging.of_log( t1.getMessage() )
Finally
	gnv_app.inv_logging.of_log( 'could not popmenu - inside finally')
End Try

Event crash info.

Faulting application name: PB190.exe, version: 19.2.0.2728, time stamp: 0x6100e4a4
Faulting module name: PBVM.dll, version: 19.2.0.2728, time stamp: 0x6100e676
Exception code: 0xc000041d
Fault offset: 0x0011ab0d
Faulting process id: 0x3e960
Faulting application start time: 0x01da3441177e0533
Faulting application path: C:\Program Files (x86)\Appeon\PowerBuilder 19.0\PB190.exe
Faulting module path: C:\Program Files (x86)\Appeon\Common\PowerBuilder\Runtime 19.2.0.2728\PBVM.dll
Report Id: 6d62679f-7682-4911-8c83-b2a794ce2da1
Faulting package full name: 
Faulting package-relative application ID: 

 

Barry Ellison Accepted Answer Pending Moderation
  1. Friday, 22 December 2023 16:45 PM UTC
  2. PowerBuilder
  3. # 1

We overrode rbuttondown and added the following couple of lines to the start of the script.  "Seems to work".

Comment
  1. Barry Ellison
  2. Friday, 22 December 2023 16:47 PM UTC
However, the long term more correct answer is to upgrade the PFC libraries. That is not for the faint of heart.
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Saturday, 23 December 2023 02:47 AM UTC
Thanks for sharing the solution!
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Friday, 22 December 2023 15:19 PM UTC
  2. PowerBuilder
  3. # 2

Hi, Barry - 

I think your premise that "the app doesn't have focus" is incorrect. Windows will not send user input event messages (such as right-mouse button, or RMB, down/up events, in this case) to a window without first firing the Activate event.

Does this error occur when the app is run from the IDE, or from a compiled executable, or both?

Is the app being deployed as 64-bit?

The code snippet you posted; in what object and event does that code reside?

The list of objects you included showing the migration errors/issues indicates that the version of the PFC/PFE libraries you are using is VERY old, as they contained the 16-bit Windows support and alternate platform support (AIX, Solaris, etc.) objects that were removed from the PFC a long time ago. If you attempted to replace only the PFC-layer libraries and did not include the PFE-layer libraries, you have in effect, orphaned objects in the (old) PFE-layer libraries by removing their PFC-layer ancestors. I suggest you not pursue this avenue at this time unless you are prepared to carefully and purposely update both the PFC- and PFE- libraries to a more current version.

Best regards, John

Comment
  1. Barry Ellison
  2. Friday, 22 December 2023 15:36 PM UTC
32-bit app, as mentioned in post this effect is seen in both PB File/Run/IDE and the executable.

If we keep the PB App as my top window, then the menu is displayed. If we click on Windows desktop taking focus away, then navigate the mouse to the datawindow where the first action is right-click on the dw, then we get the crash 100% of the time. I agree, before the right-click occurs on the object the app should get an activate event.

The script in question is rbuttondown on a datawindow which is on a userobject. There are several layers between the userobject and the parent window.

I am not surprised they are very old. This application is over 20 yrs old and the history of the PFC/PFE libraries is relatively unknown.

The migration as such would be quite daunting. I don't mind attempting it in a separate temporary workspace if it fixes the problem. I cannot replace the PFE layers b/c I know they've been modified. I would need to compare each individual object in all layers, a serious undertaking.



A co-worker has found a workaround for the moment. Executing a SetFocus() in rbuttondown() may have fixed it for the short term.
  1. Helpful
  1. John Fauss
  2. Friday, 22 December 2023 16:34 PM UTC
I'm glad to hear your co-worker has found a work-around. The PopMenu PowerScript command is typically issued from the RButtonUp event, not RButtonDown (look at these event scripts in the pfc_u_dw object). I'm not saying that is causing the issue, only that it is not typical.
  1. Helpful
There are no comments made yet.
John Raghanti Accepted Answer Pending Moderation
  1. Friday, 22 December 2023 12:18 PM UTC
  2. PowerBuilder
  3. # 3

Did you try logging to see if lw_parent is valid?

Comment
  1. Barry Ellison
  2. Friday, 22 December 2023 12:33 PM UTC
It must valid b/c the first log statement references lw_parent.pointerx() and lw_parent.pointery(). I get valid values from my log. Sample...

u_tabpg_client_desk_info: dw_1.rbuttondown before popmenu() - Frame X and Y = (923,1096)
  1. Helpful
There are no comments made yet.
Barry Ellison Accepted Answer Pending Moderation
  1. Friday, 22 December 2023 11:24 AM UTC
  2. PowerBuilder
  3. # 4

That went off the rails pretty quickly.  Maybe this is another thread?
After copying in all the PFC*.PBLs into a folder and recompiling, I'm at 182 errors while the current build has zero.

I've never personally migrated a PFC layer before.  Any instructions or best practices anywhere?
Any suggestions on determining if my predecessors modified the PFC layer?  This is new territory for me and I believe my company.  I was involved with migrating the app from 2017 to 2019 but this is not something we addressed, nor do I believe my predecessors have migrated either.  Fight these one at a time?

Here are the ones related to the PFC and PFE layers.
pfcmain.pbl(pfc_u_dw).35: Error C0001: Illegal data type: n_cst_dwsrv_grid
pfcmain.pbl(pfc_w_master).15: Error C0001: Illegal data type: n_cst_winsrv_style
pfemain.pbl(w_master).w_master.closequery.104: Error C0015: Undefined variable: ib_no
pfcmain.pbl(pfc_w_response).13: Error C0001: Illegal data type: n_cst_platformattrib
...
application errors
...
pfcapsrv.pbl(pfc_n_cst_color).10: Error C0001: Illegal data type: n_cst_platformattrib
pfcapsrv.pbl(pfc_n_cst_dwcache).25: Error C0001: Illegal data type: n_cst_dwcacheattrib
pfeapsrv.pbl(n_cst_filesrvaix).2: Error C0001: Illegal data type: pfc_n_cst_filesrvaix
pfeapsrv.pbl(n_cst_filesrvmac).2: Error C0001: Illegal data type: pfc_n_cst_filesrvmac
pfeapsrv.pbl(n_cst_filesrvsol2).2: Error C0001: Illegal data type: pfc_n_cst_filesrvsol2
pfeapsrv.pbl(n_cst_filesrvwin16).2: Error C0001: Illegal data type: pfc_n_cst_filesrvwin16
pfeapsrv.pbl(n_cst_filesrvwin32).2: Error C0001: Illegal data type: pfc_n_cst_filesrvwin32
pfeapsrv.pbl(n_cst_filesrvhpux).2: Error C0001: Illegal data type: pfc_n_cst_filesrvhpux
pfcapsrv.pbl(pfc_n_cst_platform).pfc_n_cst_platform.of_getdpix.40: Error C0001: Illegal data type: n_cst_platformattrib
pfcapsrv.pbl(pfc_n_cst_platform).pfc_n_cst_platform.of_getdpix.45: Error C0015: Undefined variable: lnvo_constants
pfeapsrv.pbl(n_cst_platformaix).2: Error C0001: Illegal data type: pfc_n_cst_platformaix
pfeapsrv.pbl(n_cst_platformmac).2: Error C0001: Illegal data type: pfc_n_cst_platformmac
pfeapsrv.pbl(n_cst_platformsol2).2: Error C0001: Illegal data type: pfc_n_cst_platformsol2
pfeapsrv.pbl(n_cst_platformunicode).2: Error C0001: Illegal data type: n_cst_platformwin32
pfeapsrv.pbl(n_cst_platformwin16).2: Error C0001: Illegal data type: pfc_n_cst_platformwin16
pfeapsrv.pbl(n_cst_platformwin32).2: Error C0001: Illegal data type: pfc_n_cst_platformwin32
pfeapsrv.pbl(n_cst_platformhpux).2: Error C0001: Illegal data type: pfc_n_cst_platformhpux
pfcapsrv.pbl(pfc_n_cst_trregistration).6: Error C0001: Illegal data type: n_cst_trregistrationattrib
pfeapsrv.pbl(w_find).w_find.open.4: Error C0015: Undefined variable: is_search_message
pfeapsrv.pbl(w_print).2: Error C0001: Illegal data type: pfc_w_print
pfcdwsrv.pbl(pfc_n_cst_dssrv_multitable).5: Error C0001: Illegal data type: n_cst_dssrv_multitableattrib
pfcdwsrv.pbl(pfc_n_cst_dwsrv_dropdownsearch).5: Error C0001: Illegal data type: n_cst_dwsrv_dropdownsearchattrib
pfcdwsrv.pbl(pfc_n_cst_dwsrv_multitable).5: Error C0001: Illegal data type: n_cst_dwsrv_multitableattrib
pfcdwsrv.pbl(pfc_n_cst_dwsrv_querymode).8: Error C0001: Illegal data type: n_cst_dwsrv_querymodeattrib
pfcdwsrv.pbl(pfc_n_cst_dwsrv_resize).26: Error C0001: Illegal data type: n_cst_dwsrv_resizeattrib
pfcdwsrv.pbl(pfc_n_cst_dwsrv_sort).20: Error C0001: Illegal data type: n_cst_dwsrv_sortdraw
pfcmain.pbl(pfc_u_tv).10: Error C0001: Illegal data type: n_cst_tvattrib
pfcutil.pbl(pfc_n_cst_debug).12: Error C0001: Illegal data type: n_cst_json
pfcwnsrv.pbl(pfc_n_cst_resize).44: Error C0001: Illegal data type: n_cst_resizeattrib
pfcwnsrv.pbl(pfc_n_cst_winsrv_sheetmanager).6: Error C0001: Illegal data type: n_cst_winsrv_sheetmanagerattrib
pfcwnsrv.pbl(pfc_n_cst_winsrv_statusbar).65: Error C0001: Illegal data type: n_cst_winsrv_statusbarattrib
pfcapsrv.pbl(pfc_n_cst_json).3: Error C0001: Illegal data type: n_cst_json_tagattrib
pfcapsrv.pbl(pbdom_document).pbdom_document.14: Error C0123: Function getownerdocumentobject differs from ancestor only by return type.
pfcapsrv.pbl(pfc_n_cst_pbunitconversion).5: Error C0001: Illegal data type: n_cst_measureconversion
pfcdwsrv.pbl(pfc_n_cst_dwsrv_sortdraw).12: Error C0001: Illegal data type: n_cst_pbunitconversion
pfcdwsrv.pbl(pfc_w_grid).pfc_w_grid.open.51: Error C0194: Missing pcode block for indirect function. Possible cause: library missing from library list.
pfcdwsrv.pbl(pfc_n_cst_dwsrv_grid).pfc_n_cst_dwsrv_grid.of_showdialog.50: Error C0015: Undefined variable: w_grid
pfcdwsrv.pbl(pfc_n_cst_dwsrv_grid).pfc_n_cst_dwsrv_grid.of_showdialog.55: Error C0094: Routine must return a value.
pfcwnsrv.pbl(pfc_n_cst_winsrv_style).9: Error C0001: Illegal data type: n_cst_platformattrib

Comment
There are no comments made yet.
Barry Ellison Accepted Answer Pending Moderation
  1. Friday, 22 December 2023 10:00 AM UTC
  2. PowerBuilder
  3. # 5

PFC Framework, yes but no on the new PFC version.  It was migrated along with the fairly large application of over 100 pbls over the past 20+ years. With the size of the application bringing in new PFC versions is scary b/c it would require an entire round of testing.  I'll bring this into a separate code base, do a full build and report back.

Failed to mention this is a dw, on a userobject as a tab page, on a tab, on a userobject on a window.  

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 22 December 2023 03:18 AM UTC
  2. PowerBuilder
  3. # 6

Hi Barry;

  It looks like your App is using the PFC framework. If so, are you using the PB 2019 R3 version of the PFC?

FYI: https://github.com/OpenSourcePFCLibraries

Regards ... Chris

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