Announcement

Collapse
No announcement yet.

PB& vs PB8

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

  • PB& vs PB8

    What is the reason that the following code will compile in PB7 but not PB 8...thanks for any help...

    #COMPILE EXE
    #INCLUDE "WIN32API.INC"
    #INCLUDE "COMMCTRL.INC"
    FUNCTION WINMAIN (BYVAL hInstance AS LONG, BYVAL hPrevInstance AS LONG, lpCmdLine AS ASCIIZ PTR, BYVAL iCmdShow AS LONG) AS LONG
    LOCAL hDlg AS LONG
    LOCAL hTrackBar AS LONG
    DIALOG NEW 0, "Track Bar",,, 200, 45, %WS_CAPTION OR %WS_SYSMENU TO hDlg
    CONTROL ADD LABEL, hDlg, 100, "", 158, 16, 20, 10
    CONTROL SET TEXT hDlg, 100, "0"
    '
    InitCommonControls
    Style& = %WS_CHILD OR %WS_VISIBLE OR %TBS_ENABLESELRANGE
    hTrackBar = CreateWindowEx(BYVAL 0, "msctls_trackbar32", "", Style&, 20, 20, 200, 40, hDlg, 200, hInstance, BYVAL 0)
    CONTROL SEND hDlg, 200, %TBM_SETRANGE, 0, MAKLNG(0, 100)
    CONTROL SEND hDlg, 200, %TBM_SETLINESIZE, 0, 1
    CONTROL SEND hDlg, 200, %TBM_SETPAGESIZE, 0, 5
    '
    DIALOG SHOW MODAL hDlg CALL DlgProc
    END FUNCTION


    CALLBACK FUNCTION DlgProc
    LOCAL ThumbPos AS LONG
    SELECT CASE CBMSG
    CASE %WM_HSCROLL
    SELECT CASE LOWRD(CBWPARAM)
    CASE %TB_THUMBTRACK
    ' Mouse activity
    ThumbPos = HIWRD(CBWPARAM)
    CONTROL SET TEXT CBHNDL, 100, STR$(ThumbPos)
    CASE %TB_LINEDOWN, %TB_LINEUP, %TB_PAGEDOWN, %TB_PAGEUP, %TB_TOP, %TB_BOTTOM
    ' Keyboard activity
    CONTROL SEND CBHNDL, 200, %TBM_GETPOS, 0, 0 TO ThumbPos
    ThumbPos = LOWRD(ThumbPos)
    CONTROL SET TEXT CBHNDL, 100, STR$(ThumbPos)
    END SELECT
    END SELECT
    END FUNCTION

  • #2
    What reason did the compiler display?

    Comment


    • #3
      What is the error message, where?

      I'll bet it is error 549 on the WinMain line.

      I'll bet when you click the 8x help file to look at error 549 it says "new"

      I'll bet "new" means 8x is the first version of PB/Windows to include this error number.
      Michael Mattias
      Tal Systems (retired)
      Port Washington WI USA
      [email protected]
      http://www.talsystems.com

      Comment


      • #4
        Yes, it is error 549...i just looked in the log file.

        What is the solution?

        Comment


        • #5
          I found the solution... and just passed the ptr as BYVAL...that all...

          thanks for the help...

          Comment


          • #6
            You might also want to think about changing your IDE settings.

            Window/Options, Compiler tab, check both "Create Log file" and "display results".

            At the conclusion of each compile you get the log file contents on the screen in a message box, and you can 'Copy' (to clipboard) the text from the log file with one click.

            (The 'copy' thing is new I think in 8x. Or maybe it was new in 7x. But the display results thing has been available back to 5x)
            Michael Mattias
            Tal Systems (retired)
            Port Washington WI USA
            [email protected]
            http://www.talsystems.com

            Comment


            • #7
              But wouldn't it be REALLY COOL if, when a compile results in an error, there were a button to click which would take you directly to the help file's explanation of that error code?

              Ooh, ooh, I like this, a lot. I think I shall send it in as a NFS.

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

              Comment

              Working...
              X