Announcement

Collapse
No announcement yet.

Toggle Maindialog to hParent dialog

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

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

  • #2
    How big of an array?
    Can you show sample code that demonstrates the problem?
    Engineer's Motto: If it aint broke take it apart and fix it

    "If at 1st you don't succeed... call it version 1.0"

    "Half of Programming is coding"....."The other 90% is DEBUGGING"

    "Document my code????" .... "WHYYY??? do you think they call it CODE? "

    Comment


    • #3
      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!!

      Comment


      • #4
        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
        Michael Mattias
        Tal Systems Inc. (retired)
        Racine WI USA
        [email protected]
        http://www.talsystems.com

        Comment


        • #5
          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/]

          Comment


          • #6
            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
            Michael Mattias
            Tal Systems Inc. (retired)
            Racine WI USA
            [email protected]
            http://www.talsystems.com

            Comment


            • #7
              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.

              Comment


              • #8
                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.
                kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

                Comment

                Working...
                X