Dean,
are you accessing ac() elsewhere? If so, should the IF loop not be executed then ac() will not be dimmed and may be undefined so if you access ac() elsewhere then you'll be accessing undefined locations in memory which could cause your problem.
Paul.
Announcement
Collapse
No announcement yet.
Virtual Keys - PB Win bombs
Collapse
X
-
>Taking the DIM statement out of the If block seems to solve the problem
If that is a second (or third...) DIM statment for that array in that procedure, it is ignored. REDIM is always obeyed. If it's your application (versus pbwin.exe) which is terminating abnornally, that would explain it.
Leave a comment:
-
-
Sorry for the late response...
Taking the DIM statement out of the If block seems to solve the problem...that leads me to believe there is something else going on...but it is working now with no limit on the virtual keys...thx...
Leave a comment:
-
-
Geez fellas. What Dean actually said was:Is there a limit to the number of Virtual Keys that can be defined...
Originally posted by dean goodman View PostThe error occurs in this sequence...If the last line is uncommented, then execution of PBwin terminates...
==========================
"A small daily task,
if it be really daily,
will beat the labors
of a spasmodic Hercules."
Anthony Trollope (1815 - )
==========================
Leave a comment:
-
-
MCM,
I read the problem as "compiled application ceased running without reporting an error". We'll have to wait for clarification from Dean.
Paul.
Leave a comment:
-
-
Suggestions to test array bounds or ERR, or consider the effects of other threads of execution are not very useful until the program compiles.
I read the problem as "won't compile."
I have another way to get the compiler (pbwin.exe 9.0.0) to fail on a GPF if anyone needs it.
Leave a comment:
-
-
Dean,
have you checked the value of ERR after you DIM your array?
Paul.
Leave a comment:
-
-
Less code provided, so can't help for sure, but you can try these:
1. Move out the DIM ac() from if block and make it global. Redim it from 0 to 15 in initialization module.
2. Check you code where boundaries of ac() might be changed by thread/sub/function. Just check out the code for an ac() array
3. You forgot to say 'Debug'--- simply, debug your application
Leave a comment:
-
-
Originally posted by dean goodman View PostThe error occurs in this sequence...If the last line is uncommented, then execution of PBwin terminates...
'Code:'PBWIN 9.00 - WinApi 05/2008 - XP Pro SP3 #Dim All #Compile Exe #Include "WIN32API.INC" ' Global hdlg As Dword Global Dlg_Hght&, Dlg_Wdth& ' Macro Common_Locals 'Macro easier than retyping and maintains coding consistency Local ctr&, ln&, ln1&, i&, s$ Local hght&, wd&, Longest&, l$ Local Row&, col& End Macro ' CallBack Function Dialog_Processor Select Case CbMsg 'This is TO determine the message TYPE ' Case %WM_INITDIALOG'<- Initialiaton when the program loads ' Case %WM_SYSCOMMAND 'Traps Any Alt key but only F4 closes ' Case %WM_COMMAND 'This processes command messages Select Case CbCtl 'Case %Id_ Select Case CbCtlMsg End Select End Select End Select End Function ' Function PBMain Dialog New Pixels, hdlg, "Demo", , , 400, 400, %WS_SYSMENU To hdlg ' Local hDlggl3d As Dword Local s As String Local result As Long Dim ac(15) As ACCELAPI ac(0).fvirt = %fvirtkey : ac(0).key = %vk_left : ac(0).cmd = %wm_user + %vk_left ac(1).fvirt = %fvirtkey : ac(1).key = %vk_right : ac(1).cmd = %wm_user + %vk_right ac(2).fvirt = %fvirtkey : ac(2).key = %vk_up : ac(2).cmd = %wm_user + %vk_up ac(3).fvirt = %fvirtkey : ac(3).key = %vk_down : ac(3).cmd = %wm_user + %vk_down ac(4).fvirt = %fvirtkey : ac(4).key = %vk_pgup : ac(4).cmd = %wm_user + %vk_pgup ac(5).fvirt = %fvirtkey : ac(5).key = %vk_pgdn : ac(5).cmd = %wm_user + %vk_pgdn ac(6).fvirt = %fvirtkey : ac(6).key = Asc(Chr$(72)) : ac(6).cmd = %wm_user +Asc(Chr$(72)) ' h key ac(7).fvirt = %fvirtkey : ac(7).key = Asc(Chr$(76)) : ac(7).cmd = %wm_user +Asc(Chr$(76)) ' l key ac(8).fvirt = %fvirtkey : ac(8).key = Asc(Chr$(87)) : ac(8).cmd = %wm_user +Asc(Chr$(87)) ' w key ac(9).fvirt = %fvirtkey : ac(9).key = Asc(Chr$(71)) : ac(9).cmd = %wm_user +Asc(Chr$(71)) ' h key ac(10).fvirt = %fvirtkey : ac(10).key = Asc(Chr$(75)) : ac(10).cmd = %wm_user +Asc(Chr$(75)) ' l key ac(11).fvirt = %fvirtkey : ac(11).key = Asc(Chr$(81)) : ac(11).cmd = %wm_user +Asc(Chr$(81)) ' w key ac(12).fvirt = %fvirtkey : ac(12).key = Asc(Chr$(82)) : ac(12).cmd = %wm_user +Asc(Chr$(82)) ' r key ac(13).fvirt = %fvirtkey : ac(13).key = Asc(Chr$(69)) : ac(13).cmd = %wm_user +Asc(Chr$(69)) ' e key Accel Attach hDlg, ac() To result '<<<<<<< only changed handle name Dialog Show Modal hDlg Call Dialog_Processor End Function 'Applikation fursvhtunken '
Leave a comment:
-
-
The error occurs in this sequence...If the last line is uncommented, then execution of PBwin terminates...
IF master$="Open GL Draw" THEN
DIM ac(15) AS ACCELAPI
ac(0).fvirt = %fvirtkey : ac(0).key = %vk_left : ac(0).cmd = %wm_user + %vk_left
ac(1).fvirt = %fvirtkey : ac(1).key = %vk_right : ac(1).cmd = %wm_user + %vk_right
ac(2).fvirt = %fvirtkey : ac(2).key = %vk_up : ac(2).cmd = %wm_user + %vk_up
ac(3).fvirt = %fvirtkey : ac(3).key = %vk_down : ac(3).cmd = %wm_user + %vk_down
ac(4).fvirt = %fvirtkey : ac(4).key = %vk_pgup : ac(4).cmd = %wm_user + %vk_pgup
ac(5).fvirt = %fvirtkey : ac(5).key = %vk_pgdn : ac(5).cmd = %wm_user + %vk_pgdn
ac(6).fvirt = %fvirtkey : ac(6).key = ASC(CHR$(72)) : ac(6).cmd = %wm_user +ASC(CHR$(72)) ' h key
ac(7).fvirt = %fvirtkey : ac(7).key = ASC(CHR$(76)) : ac(7).cmd = %wm_user +ASC(CHR$(76)) ' l key
ac(8).fvirt = %fvirtkey : ac(8).key = ASC(CHR$(87)) : ac(8).cmd = %wm_user +ASC(CHR$(87)) ' w key
ac(9).fvirt = %fvirtkey : ac(9).key = ASC(CHR$(71)) : ac(9).cmd = %wm_user +ASC(CHR$(71)) ' h key
ac(10).fvirt = %fvirtkey : ac(10).key = ASC(CHR$(75)) : ac(10).cmd = %wm_user +ASC(CHR$(75)) ' l key
ac(11).fvirt = %fvirtkey : ac(11).key = ASC(CHR$(81)) : ac(11).cmd = %wm_user +ASC(CHR$(81)) ' w key
ac(12).fvirt = %fvirtkey : ac(12).key = ASC(CHR$(82)) : ac(12).cmd = %wm_user +ASC(CHR$(82)) ' r key
' ac(13).fvirt = %fvirtkey : ac(13).key = ASC(CHR$(69)) : ac(13).cmd = %wm_user +ASC(CHR$(69)) ' e key
ACCEL ATTACH hDlggl3d, ac() TO result
END IF
Leave a comment:
-
-
Originally posted by dean goodman View PostWhat might be wrong in my code?
Leave a comment:
-
-
Virtual Keys - PB Win bombs
Is there a limit to the number of Virtual Keys that can be defined...In any event, in my program I am able to get PBwin bomb out of executing. I have never seen that happen before.
I have wired it down to number of virtual keys defined. I have it at 13/14 which seems to trigger PB Win to fail...Anyone else seen this behaviour...What might be wrong in my code?
Thanks for any help...Tags: None
-
Leave a comment: