Announcement

Collapse
No announcement yet.

Need Help with ERROR 546

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

  • #21
    Robert
    When Fred asked:
    Robert, at the place the program fails you are calling a callback function.

    Why would you do that ?
    he was referring to 'calling a callback" when the help file explicitly states:

    It may never be called directly from your code.
    Further, this line:
    Code:
    PBMAIN=15
    is merely assigning an error number to the return value, you'll find your program runs just as well without it, since you aren't experiencing that error yet.(If it exists at all)
    Rod
    In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

    Comment


    • #22
      Yes that was the wrong thing to do. I have run into this before and fixed it by using FUNCTION instead of CALLBACK FUNCTION. But in this case I had a 'SELECT CASE CBMSG ' in the RECORDS1 code and that gave an error since that needs a CALLBACK FUNCTION to work.

      The PBMAIN=15 was just what is shown in the help file for PBMAIN function. Guess there may things in sample files that are not needed.
      Robert

      Comment


      • #23
        I have run into this [attempting to call a CALLBACK FUNCTION from code ] before and fixed it by using FUNCTION instead of CALLBACK FUNCTION. But ...
        But..... you did not FIX anything. While it 'can' be done and sometimes 'is' done, Window procedures - CALLBACK FUNCTIONS - are not intended to be used as procedures you call directly from your code. There are 'things' you never see which happen in window procedures , and those should only be allowed to happen when that procedure is called 'as normally called' which is 'automatically as a result of user actions or other events'

        If you really want to call a CALLBACK FUNCTION directly from your code, you can fool the compiler into performing that action easily enough with CALL DWORD. However, the compiler edit which prevents you from coding a simple call of a CALLBACK FUNCTION is there for a good reason.

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

        Comment


        • #24
          Robert, It sounds like you are wanting your program to react like a MS-DOS counterpart would react. Many functions and subs will do just that but not when dealing with dialogs(DDT-SDK)/windows (SDK CreateWindow etc).

          Windows programming in those instances is a 'different animal'.
          A quick example might give you some insight.
          If you have a callback function that handles all the controls and you put text in a textbox lets say. Under that select case statement for that control, if you
          put an exit function statement, the program will not actually exit the function.
          Well that may be oversimplification. Perhaps a better explanation would be that it will go back to the callback function until the dialog is ended (modal dialog assumed). That may be a bad example but it shows that windows programming is not the same as MS-DOS programming where windows are concerned.

          I am, by no means, the expert here. Others, MCM, Gosta, and others are much more knowledgable about windows programming than I am so listen to them. They know of what they speak.
          Client Writeup for the CPA

          buffs.proboards2.com

          Links Page

          Comment


          • #25
            Originally posted by Fred Buffington View Post
            I am, by no means, the expert here. Others, MCM, Gosta, and others are much more knowledgable about windows programming than I am so listen to them. They know of what they speak.
            {laughing}Fred, that just make laugh out loud. {still laughing} Unless your intent was to irk MCM, which I'm sure it (putting me in the same league, much less ballpark, as him when it comes to Win programming) does.

            Geez, I'm still laughing. Probably the extra glee I feel thinking about MCM getting irked.

            ========================
            "Always do right
            this will gratify some
            and astonish the rest."
            Mark Twain (1835-1910)
            ========================
            It's a pretty day. I hope you enjoy it.

            Gösta

            JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
            LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

            Comment


            • #26
              Yes Fred, my windows program are much like DOS. Since windows came out I have never liked all the extra clicking to run simple programs.

              At my work I use many window programs including CAD programs which are complex to use, and I see many ways in which the programs could be simplified if they operated in some way like DOS.
              Robert

              Comment


              • #27
                >Yes Fred, my windows program are much like DOS

                You may want them to 'look and feel' like MS-DOS programs, but you can't write 'em like you write MS-DOS programs.....

                .. except....

                ..you should probably look at the PB Console Compiler. Even when you do 'graphic' things with the new GRAPHIC WINDOW support, these are coded much like MS-DOS programs are coded, where you rather than the user control the program flow.

                The basic difference between writing "GUI" programs and writing "Console" style programs in the user interface area is, with Console/MS-DOS programs you ASK if the user has clicked a button or typed a character; in GUI programs Windows TELLS you these things have happened and you must react.

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

                Comment

                Working...
                X