Subject: No CMGetRefCon inside serial completion routine?
Message-ID: <6804@ucsbcsl.ucsb.edu>
Date: 21 Nov 92 00:08:44 GMT
Sender: root@ucsbcsl.ucsb.edu
Organization: University of California, Santa Barbara
Lines: 38
I'm writing a program to process data from a scanner using the Comm Toolbox.
It appears that CMGetRefCon cannot be used inside a completetion routine when doing serial I/O. I have discovered the first code snippet below works, and the
second one doesn't. I find it difficult to believe the CMGetRefCon allocates
memory, or does anything else too dastardly to mention in a completion routine
(In fact I hardly see the point for having it at all, but I was trying to be
a good Macintosh citizen and use it anyway...) Any thoughts or comments?
Please email me, I can't quite manage to keep up with this newsgroup. I'll
post a summary if folks express interest.
void
finish_read(ConnHandle my_conn ) { // This one works
Port *thePort;
thePort = (Port *) (**my_conn).refCon;
// The following two lines are
// specific to the data structure pointed to by my refcon