Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!psuvax1!atlantis.psu.edu!psuecl!d1d From: d1d@ecl.psu.edu Newsgroups: comp.sys.mac.programmer Subject: writing CDEF's in THINK C Message-ID: <1991Jun18.151540.1386@ecl.psu.edu> Date: 18 Jun 91 19:15:40 GMT Organization: Engineering Computer Lab, Pennsylvania State University Lines: 23 Could anybody describe the necessary steps to implement a CDEF and attach it to a control item in a dialog? This is what I have done, but without much success: (in THINK C) 1. Wrote a little subroutine, just a described in I.M. I in the Control Manager section, to play the role of the controlDef Procedure.Declared it as: pascal long CDef(...) 2. I wanted it to be compiled and saved as a CDEF resource which should be just the compiled source code. So I compiled the project as a Source Code Segment of type CDEF and merged it into my resource file. Then had the CNTL resource indicate the appropriate CDEF resource *16 in its ProcID field. 3. My program bombs when it reads in the dialog as defined in the resource file. I even tried pointing my controlDefHandle in the controlRecord to the pascal procedure itself, but failed. If you have any suggestions about how to do this in THINK C (not in assembly) please let me know, Thanks Dimitris, Daskopoulos. D1D@ECL.PSU.EDU