Announcement

Collapse
No announcement yet.

Pbedit-OLEAUT32 bomb

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

  • Pbedit-OLEAUT32 bomb

    Hi Everyone,

    I'm still relatively new to PBDLL 6, but I did a search of the
    BBS and couldn't find a similar report of this.

    On my computers (laptop or desktop) I get a critical Windows
    error "Invalid page fault in Oleaut32". This occurs when I
    select a prior used file from the Most Recently Used list on
    the File menu in PBEDIT, and then try to Trace Into a function
    call using the debugger.

    However, if I use the "Open" command from the File menu and
    switch to the directory where the source is located I have no
    trouble using the debugger to trace into etc...

    Is this a documented problem or is there something that I
    might be doing wrong?

    Thanks,



    ------------------
    Paul Squires
    [email protected]
    Paul Squires
    FireFly Visual Designer (for PowerBASIC Windows 10+)
    Version 3 now available.
    http://www.planetsquires.com

  • #2
    Paul,

    When you load a file from the "recent files" list in the IDE's FILE menu, the code is loaded, but the current directory is not altered. This is the only difference between navigating to a file and using the "Recent Files" list.

    Regarding the Page Fault error (GPF)... since the current directory is probably not where your code is actually located, your code may not be able to load data from disk files unless your code explicitly references such data files with their full directory path. Assuming this is what is happening to you, you code will be trying to manipulate data that could not actually be read.

    In other words, if you do not explicitly test ERR after opening a file and attempting to read data, run-time errors or GPF's can occur because your code was not fail-safe.

    The easiest solution is to include a small block of code that explicitly sets the current path (to where your data files reside) when your app first starts:
    Code:
    %Debug = -1
    FUNCTION PBMAIN
    #IF %Debug
      CHDRIVE "F:"
      CHDIR "\My Test Applications\Project 37\New\Data"
    #ENDIF
     
      OPEN "TESTDATA.DAT" FOR INPUT AS #1
      IF ERR THEN MSGBOX "Oh-no! The data file is missing!"
    ... etc
    END FUNCTION
    I hope this helps...

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Thanks Lance.

      I assumed that the default directory was not changing when I
      loaded the source from the MRU list. I tried using your
      suggestion and included CHDRIVE and CHDIR - but the same invalid
      page fault error occurred. I verified that the directory actually did
      changed by testing CURDIR$.

      For greater certainty this is my scenario. I run PBEDIT from the
      directory that the PB install program puts it (on my computer
      that is c:\pbdll60\bin). My source code is in a different
      directory.

      When I compile the code and try to step through it using the
      debugger, the error will occur when I try to "step into" a
      function whose source is included in the different directory. That
      source is #INCLUDED in the main source. I thought that the
      compiler successfully found the #INCLUDE source at compile time
      because there were no errors reported. However, when tracing
      the code with the debugger the error occurs.

      Strange. Maybe its something wierd tied to my version of the
      OLE automation DLLs.

      Thanks for your help. No need to go any further with this because
      I won't use the MRU list to load this project.



      ------------------
      Paul Squires
      [email protected]
      Paul Squires
      FireFly Visual Designer (for PowerBASIC Windows 10+)
      Version 3 now available.
      http://www.planetsquires.com

      Comment


      • #4
        It does sound like the problem is that the debugger cannot find the INC file, rather than the code failing...

        The problem has to relate to the current directory...

        If you use my earlier suggestion to change the path at runtime, the compiler will locate the INC file during initial compilation, but the debugger may not be able to find it when the path changes as you step through the code, since the current directory "changed".




        ------------------
        Lance
        PowerBASIC Support
        mailto:[email protected][email protected]</A>
        Lance
        mailto:[email protected]

        Comment


        • #5
          Whoa, I think I know where he's going with that error, encountered it myself.

          There's a function, dang if I can remember which one it is, but on an old version with the initial install of PBDLL it has no byval in it, but it requires it to be there..

          If not, BOOM.

          I'll find it and be bakc shortly...

          Scott


          ------------------
          Scott
          mailto:[email protected][email protected]</A>
          Scott Turchin
          MCSE, MCP+I
          http://www.tngbbs.com
          ----------------------
          True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

          Comment


          • #6
            OK Paul, check your calls, this is the one that got me:

            DECLARE FUNCTION VariantTimeToSystemTime LIB "OLEAUT32.DLL" ALIAS "VariantTimeToSystemTime" (BYVAL vbtime AS DOUBLE, lpSystemTime AS SYSTEMTIME) AS LONG


            If that byval is NOT in there on the vbtime, you will get a LOT of weird stuff happening.

            This may not be your function, but check them, seems there were two or three out of sync...
            TOok me DAYS to catch that byval, and somewhere up here is a message 14 posts long about troubleshooting it, but it all came down to that byval.

            Scott

            ------------------
            Scott
            mailto:[email protected][email protected]</A>
            Scott Turchin
            MCSE, MCP+I
            http://www.tngbbs.com
            ----------------------
            True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

            Comment


            • #7
              Scott, I'm not sure I can see how that could be the issue, since the problem reportedly only shows up when the app is loaded into the IDE from the Recent Files list... maybe I'm looking at this all wrong, but if the code was passing a parameter incorrectly to an API, surely the code would GPF regardless of how the code was loaded and compiled...

              ------------------
              Lance
              PowerBASIC Support
              mailto:[email protected][email protected]</A>
              Lance
              mailto:[email protected]

              Comment


              • #8
                Hi Scott,

                Thanks for the heads up on that error. Unfortunately, that
                function is not in my source. Lance has a good point - the crash
                only seems to happen when the source is loaded from the Most
                Recently Used list, so the cause must lie somewhere in the
                interaction of the source directories and the debugger trying
                to read them during execution of a "trace into".

                Thanks,


                ------------------
                Paul Squires
                [email protected]
                Paul Squires
                FireFly Visual Designer (for PowerBASIC Windows 10+)
                Version 3 now available.
                http://www.planetsquires.com

                Comment

                Working...
                X