OMG, i've spent a week to find the reason why this code is crashing with the same Call Stack Status access violation problem?
I've tried to scale it down whole week to be small, here it is.
Click Graph, then click somewhere on the graph area and press F2. When property sheet appears, close it by pressing OK (or the same does Esc to close it). It crashes
If Graph is not in the focus though you can open and close property sheet no problems pressing Settings on main window. It also works if number of property sheet tabs is less then 11, but in main code where there is a lot of other things 10 is also not working)
combine two parts
module all_declars
integer kFinishedStatus, ilwGrWinDOWActive, lwCtrlSettingsMain, khwCtrlSettingsMain, kRun
integer n_CurrSheetSettings
real*8 progressBar
integer lx_GrWindow, ly_GrWindow, &
iDOWPosYaxisRightFromRight, iDOWPosYaxisLeftFromLeft, &
iDOWPosXaxisTopFromTop, iDOWPosXaxisBottomFromBottom,&
iVolPosYaxisRightFromRight, iVolPosYaxisLeftFromLeft,&
iVolPosXaxisTopFromTop, iVolPosXaxisBottomFromBottom
SAVE
CONTAINS
end module all_declars
!==================================================================
Program QTst
use clrwin
use all_declars
integer Settings, cb_DOWGraph ,LongRun
external Settings, cb_DOWGraph ,LongRun
lwCtrlSettingsMain = 1111
kFinishedStatus = 1
n_CurrSheetSettings = 1
ilwGrWinDOWActive= 1
!---
i=WINIO@('%ww%bg[btnface]&')
i=winio@('%sf%ts&',0.8d0)
i=WINIO@('%mn[File[Exit]]&','exit')
i=WINIO@('%mn[Settings[Main Options]]&',Settings)
i=WINIO@('%ac[F2]&',Settings)
i=WINIO@('%ac[F3]&',cb_DOWGraph)
i=WINIO@('%ac[esc]&','exit')
i=WINIO@('%ac[Alt+X]&','+','set',ilwGrWinDOWActive,0,'+','set',kRun,0,'exit')
i=WINIO@('%nr%nd&')
i=WINIO@(' %^tt[Graph] &',cb_DOWGraph)
i=WINIO@(' %^tt[Settings]%ff&',Settings)
i=WINIO@('%pv%`bg%120.40cw[hscroll,vscroll]&', rgb@(224,224,255), luncw1)
i=winio@('%pm[Save Highlighted Text in Clipboard'//char(9)//'Ctrl+C]&', 'COPY' )
i=winio@('%pm[Paste Clipboard Text'//char(9)//'Ctrl+V]&','PASTE')
i=winio@('%ac[Ctrl+C]','COPY')
10000 continue
end
!-----------------------------------------------------
integer function cb_DOWGraph ()
use mswin ! clrwin
use all_declars
integer mouse_pos, Settings
external mouse_pos, Settings
CALL PERMIT_ANOTHER_callback@()
lx_GrWindow=600; ly_GrWindow=400
jj=WINIO@('%ww[no_border]%bg[btnface]&')
jj=WINIO@('%ac[Alt+X]&','+','set',ilwGrWinDOWActive,0,'+','exit','set',ihwGrWinDOWActive,0)
jj=WINIO@('%ac[F2]&',Settings)
j = winio@('%pv%^`gr[rgb_colours,black,box_selection,user_resize,full_mouse_input]&',&
& lx_GrWindow, ly_GrWindow, ihwGrWinDOWActive, mouse_pos)
! j=winio@('%lw[owned]',ilwGrWinDOWActive)
j=winio@('%lw',ilwGrWinDOWActive)
cb_DOWGraph = 1
end function cb_DOWGraph
!-------------------------------------------------------
integer function mouse_pos ()
include <windows.ins>
integer plotDOWGraph
external plotDOWGraph
jj=plotDOWGraph()
mouse_pos=1
end function mouse_pos
