[futurebasic] Re: Problem with CTB callback crashing ?

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 1997 : Group Archive : Group : All Groups

From: Greg_Neagle@...
Date: Tue, 16 Dec 1997 10:09:53 -0800
On 12/16/97 at 3:44 AM, futurebasic@... 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

GOTO "After SearchCallBackProc"
ENTERPROC(gHConn&, gMatchPtr&, gRefNum&)
      FN MySearchCallBack(gHConn&, gMatchPtr&, gRefNum&)  'call the FB function
"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