Problem with CTB callback crashing ?
Quote from Forum Archives on December 16, 1997, 6:44 amPosted by: mags <mags@...>
Hello All,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% = _CmsearchsevenbitgActiveSearch& = FN CMAddSearch(gModemConn&,searchTxt$,flags%,callBackProc&)
My problem occurs when CMRead calls the Search Call Back.
>From what I can understand the connection manager should return three
variables to the CallBack ie,LOCAL FN MySearchCallBack (HConn&, MatchPtr&, RefNum&)
END FN
This seems to happen OK however when the code steps through END FN
my system crashes even if I have left the function empty as I have
done above.According to Inside Mac the HConn& should be the connection record the
search was called from and RefNum& should be the same as gActiveSearch&.
>From looking at the code while running the Debugger this is not the case.
HConn& is the same as gActiveSearch& and RefNum& seems to be always 1.Confused to say the least.
Has anyone any suggestions ?
Thanks in advance,
Sean.
Posted by: mags <mags@...>
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.
>From what I can understand the connection manager should return three
variables to the CallBack ie,
LOCAL FN MySearchCallBack (HConn&, MatchPtr&, RefNum&)
END FN
This seems to happen OK however when the code steps through END FN
my system crashes even if I have left the function empty as I have
done above.
According to Inside Mac the HConn& should be the connection record the
search was called from and RefNum& should be the same as gActiveSearch&.
>From looking at the code while running the Debugger this is not the case.
HConn& is the same as gActiveSearch& and RefNum& seems to be always 1.
Confused to say the least.
Has anyone any suggestions ?
Thanks in advance,
Sean.