Oops.
The "Dim hDlgScreen As Long" in the attachment should have read "Dim hdlgCurrentScreen As Long".
I copied and pasted the wrong statement.
Sorry.
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)
Thought for the day (in a broad Australian accent):<br />First of all yer gungadin. Afterwards yer gungadout.
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.
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.
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
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
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.
Bookmarks