Forum Navigation
You need to log in to create posts and topics.

Re: Problem with CTB callback crashing ?

Posted by: Greg_Neagle <Greg_Neagle@...>

On 12/16/97 at 3:44 AM, futurebasic@welovegod.org wrote:

:I seem to be having a little problem with a CommsToolBox
:call back.
:
:I have added a search to the incoming data using the
:CMAddSearch function. This seems to work OK and returns
:a valid Reference number.
:
:callBackProc& = @FN MySearchCallBack
:flags% = _Cmsearchsevenbit
:
:gActiveSearch& = FN CMAddSearch(gModemConn&,searchTxt$,flags%,callBackProc&)
:
:
:My problem occurs when CMRead calls the Search Call Back.

You cannot use an FB local fn as a callback proc. Instead you must use the

ENTERPROC/EXITPROC pair, with all its quirks and limitations (no local
varables; global only; quirky behavior when not in the first segment of your
app).

GOTO "After SearchCallBackProc"
"SearchCallBackProc"
ENTERPROC(gHConn&, gMatchPtr&, gRefNum&)
FN MySearchCallBack(gHConn&, gMatchPtr&, gRefNum&) 'call the FB function
EXITPROC
"After SearchCallBackProc"

callBackProc& = LINE "SearchCallBackProc"
flags% = _Cmsearchsevenbit

gActiveSearch& = FN CMAddSearch(gModemConn&,searchTxt$,flags%,callBackProc&)

FB^3 should help in this matter by allowing you to define functions that use
PASCAL-style calling conventions.

(Note, if you receive this message with the characters "3D" after every equals
sign, my attempt at working around the prevously discussed MIME encoding errors
has failed. Just manually remove (or ignore) the "3D" after each equals sign.)

- via BulkRate 2.6.x