Results 1 to 6 of 6

Thread: Callback Error

  1. #1

    Callback Error

    Hi Folks,

    Attached is a callback error I've been getting.

    I already have a multi-level menu display screen working well in the same program.

    I pretty much copied and pasted the logic for this more general screen display, but something is amiss.

    If anything obvious stands out, please let me know. I'm really after the concepts that can lead to the particular error that is appearing.

    Once again, the logic presented is an extract of the relevant statements. It excludes the voluminous and specialised database interaction logic.

    Thanks,

    Peter H. (gungadout)
    Attached Files Attached Files
    Thought for the day (in a broad Australian accent):<br />First of all yer gungadin. Afterwards yer gungadout.

  2. #2

    Re: Callback Error

    Oops.

    The "Dim hDlgScreen As Long" in the attachment should have read "Dim hdlgCurrentScreen As Long".

    I copied and pasted the wrong statement.

    Sorry.
    Thought for the day (in a broad Australian accent):<br />First of all yer gungadin. Afterwards yer gungadout.

  3. #3

    Re: Callback Error

    Without having a system here to test on, I would guess that you should remove the CALL part out of the offending line. The documenation shows it but I never used it.

  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,129
    Rep Power
    732

    Re: Callback Error

    Hi,

    I think the reported error is correct. Your dialog callback is defined as classic function:
    [code=thinbasic]
    Function cbDialogScreen()
    ...
    End Function
    [/code]

    but it should be callback function:
    [code=thinbasic]
    Callback Function cbDialogScreen()
    ...
    End Function
    [/code]

    You may wonder why... The reason is that callback functions have special handling, which allows preallocation and filling of CBHNDL, CBCTL and other CB* stuff to them.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  5. #5
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,780
    Rep Power
    10

    Re: Callback Error

    Exactly Petr.

    Callback functions are special functions because (as Petr stated) during execution of a Callback Windows message pump variables (meta variables CB*) are create and destroyed on the fly. Also special internal structures are allocated in order to manage that variable values.

    The value of CB* variables are taken directly from Windows message handling process.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  6. #6

    Re: Callback Error

    Thanks, Folks.

    That solved the problem.

    That instruction must have been one of those that I coded from scratch, not one of those that I copied and changed.

    Regards,

    Peter H. (gungadout)
    Thought for the day (in a broad Australian accent):<br />First of all yer gungadin. Afterwards yer gungadout.

Similar Threads

  1. Animation within a Callback
    By marcuslee in forum thinBasic General
    Replies: 2
    Last Post: 03-09-2010, 16:57

Members who have read this thread: 1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •