[comp.sys.mac.programmer] writing CDEF's in THINK C

d1d@ecl.psu.edu (06/19/91)

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