Announcement

Collapse
No announcement yet.

Toggle Maindialog to hParent dialog

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Kev Peel
    replied
    Check ARRAYATTR(arrayname, 0) or ARRAYATTR(arrayname, 3), You may be accessing the array before it's dimensioned. This is an easy mistake to make if, for example, the array is dimensioned in WM_INITDIALOG and accessed in response to another message that is received before WM_INITDIALOG.

    The message order is never guaranteed in a queue-based system like Windows.

    Leave a comment:


  • BRENT GARDNER
    replied
    Looks like hDlg54 needs to send a user message to close. Seems to
    work now, I just sent user message like in maindialog, but with a different number and haven't been getting any errors! Knock on wood.

    Leave a comment:


  • Michael Mattias
    replied
    Thank you for posting the code.

    After careful review, drawing on my many years of experience, risking my entire reputation and doing it all at no charge, I will state that no statement in the code posted can cause a page fault and your problem is elsewhere.

    MCM

    Leave a comment:


  • BRENT GARDNER
    replied
    Lastest error: Program caused invalid page fault in module USER.EXE at 0008:0000185f. Program seemed to work fine, even pressing hot keys until I pressed "x" for the [E&xit] button. Then got above error?
    Seems like the old Windows 98 1 key press execution to quit causes this?
    Is there a message I can send? If I left mouse click on [E&xit] button,
    no error?

    Maindialog(hDlg) Case that calls hDlg54:
    [CODE]
    CASE 17 ' <v %ID_VIEW
    CBID = 17: KEYP = 9 ' Stop music with left Mouse click on button
    IF KEYP = 9 THEN
    CONTROL SEND CBHNDL, %ID_VIEW, %BM_SETSTATE, %TRUE, 0
    SLEEP 50
    CONTROL SEND CBHNDL, %ID_VIEW, %BM_SETSTATE, %FALSE, 0
    END IF

    DIALOG DISABLE hDlg
    DIALOG SHOW STATE hDlg, %SW_MINIMIZE
    DialogActFlg = 1 ' for redraw hDlg54
    ' Toggle to hDlg54, SUB ViewBookPage
    CALL ViewBookPage
    DIALOG ENABLE hDlg
    DIALOG SHOW STATE hDlg, %SW_NORMAL
    FUNCTION = 1

    KEYP = 0
    ' So Red rectangle will show around button, 10-7-2007
    CONTROL SET FOCUS hDlg, %ID_VIEW
    [CODE/]
    Sample code for Sub and callback
    [CODE]
    SUB ViewBookPage
    ' Set/Display the 1st address from the UDT array into the GUI
    UdtViewPageDialog hDlg54, gCurrentEntry
    KEYP = 0

    DIALOG SHOW MODAL hDlg54, CALL ViewBookPageCallBack

    DIALOG END hDlg54
    hDlg54 = 0
    END SUB

    CALLBACK FUNCTION ViewBookPageCallBack
    CASE %IDB_CNSL ' [E&xit] = 1053
    IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
    ssec=0 'reset time on exit
    FIRPOS = 0: CURRPOS = 0: INDX = 0
    DialogActFlg = 0 ' if 1, called by hDlg54
    DIALOG END CBHNDL, 1 ' end dialog
    END IF
    FUNCTION = 1
    end function
    [CODE/]

    Leave a comment:


  • Michael Mattias
    replied
    A "Stack or Page Fault" ("GPF") is the result of a program error.

    Program errors are caused by errors in your source code.

    Your source code cannot be analyzed and debugged by telepathy.

    MCM

    Leave a comment:


  • BRENT GARDNER
    replied
    The array is a string of about 1850. The wierd thing is, that after testing
    numerous times on 98, and calling from different places, I get STACK
    OR PAGE FAULT IN KERNEL32.DLL at 017f:bff7429e. But, it seems to
    only happen when I press hot key, but not if left mouse click on button?
    Stumped!!

    Leave a comment:


  • Cliff Nichols
    replied
    How big of an array?
    Can you show sample code that demonstrates the problem?

    Leave a comment:


  • BRENT GARDNER
    started a topic Toggle Maindialog to hParent dialog

    Toggle Maindialog to hParent dialog

    Hi,

    My program starts by loading array and many files. It calls a hParent dialog with a certain view. When users Quits, Maindialog is opened.
    There is a button, when executed, will call hParent dialog, but need to close maindialog while hParent dialog is running?
    In Windows XP, works fine. Problem in Windows 98, get Stack Fault
    in module kernel32.dll?

    I am assuming that there are too many string variables with both dialogs
    opened at same time.
Working...
X