Announcement

Collapse
No announcement yet.

GetLastFunction

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

  • GetLastFunction

    This may be comparing Apples vs Oranges but I had to ask.

    Java has a function of "GetLastFunction" much like Windows "GetLastError" sort of thing. But I wonder if there is an API that is "GetLastFunction"???
    I am guessing not, because it appears that it may be they are doing the same thing I am doing on my 1st attempt at tracking down bugs out of my control and have a wrapper function that I pass a string to the function to log what I called just prior to the error.

    AKA, if I call
    Code:
    SendMessage hDlg, %WM_SIZE, 0, 0
    then the line before I call
    SetLastFunction = "SendMessage hDlg, %WM_SIZE, 0, 0"

    I was looking for a more generic solution than passing a string copy of what I am about to call (although it looks like that is what java does), but wondered if such a thing exists in the API??? or am I going about it the only way I can?? or is there a better way?? (seeing how I am looking at it as "SetLastFunction =" could be anything from a SendMessage to a home-made function with unknown number of parameters)

    Hopefully someone gets what I am after and maybe an answer??? :wavey:
    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? "

  • #2
    Cliff, what are you REALLY after? I mean, it's not like your program does not know what it last did.

    Or are you just looking for a way to avoid the tedium of writing debug code?

    BTW, you should never send WM_SIZE yourself, it's a notification . Maybe that's your whole problem.

    MCM
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Cliff, this won't solve your problem, but it may entertain you: Anubis programming language - a programming language designed to avoid programming errors!

      Comment


      • #4
        MCM...you got me....I guess a bad example

        More or less I am still researching buggy problems back in my post of Richedit with RTF and a picture in the RTF
        hLib_RichEdit = LoadLibrary( "RICHED32" )
        , which is what spurned my idea to beef up debugging in the more than usual debugging concepts

        Invalid Memory Locations

        Which you were extremely helpful in pointing out what debugger does vs logging via TRACE and using "#DEBUG ERROR OFF"

        Post 13 from me of course kinda demo'ed what the problem was (and still is) and works fine until I put any sort of command related to "TRACE", and if no picture then I can find an error but no clue where .... and if I include picture, it GPF's (or whatever the correct term is for "Stops working, and Windows ask for a solution)

        So part of my tracking was..."Before I call it...log it" so maybe I can track down richedit..or winapi??? or something unknown to me???

        And yes, its important to figure out, but how much time am I willing to invest in researching? or is it worth it? or will it crop up again?....the answer as we all know is detrimental....but if it happens once....it will happen again.

        (That and "TRACE" is sooooo good usually, I hate to submit a bug report until I can track if its me mis-using a function...or if there is really a bug???)

        so the next step was to see just how far and how deep can debugging really go???? When you are still REALLLLLY stuck at a level that shows no answers...only more questions???
        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


        • #5
          I know you posted a whole package of stuff and were I so inclined I could dig it out but let's keep it simple:

          Are all the the instrinsic compiler functions performing as advertised? If so, there is no error to report to PowerBASIC, Inc.

          The Windows functions you are calling (Still streaming that RTF in? Or did you try EM_SETTEXTEX as was suggested?) will almost certainly offer some kind of return value you can test. No, not ALL functions do, but there's only a handful which don't.

          But let me suggest your problem may be related to the control trying to update itself on the screen before the picture data are complete; so change to code to prevent that.

          Disable the redraw for the control before you put the text in (WM_SETREDRAW message), put (stream or SetTextEx) the text in, then re-enable the redraw (WM_SETREDRAW again) and force an update (UpdateWindow()) (Checking return codes all along the way, of course).

          Hell, it's worth a try.

          MCM
          Michael Mattias
          Tal Systems (retired)
          Port Washington WI USA
          [email protected]
          http://www.talsystems.com

          Comment

          Working...
          X