Path: utzoo!attcan!uunet!dino!ux1.cso.uiuc.edu!brutus.cs.uiuc.edu!wuarchive!cec2!rah0777 From: rah0777@cec1.wustl.edu (Rexford Alan Hill) Newsgroups: comp.sys.mac.programmer Subject: CODE resources AGAIN Message-ID: <1990Jul12.140806.21704@cec1.wustl.edu> Date: 12 Jul 90 14:08:06 GMT Sender: news@cec2 (USENET News System) Distribution: na Organization: Washington University, St. Louis MO Lines: 53 I'm sorry to keep wasting bandwidth with this problem, but I've gotta correct my previous posting: Background: I've compiled a CODE resource of my own type 'XFRM' in THINK C 3.0 that has a main that looks like this: main() { MoveTo(10,10); LineTo(50,50); } I've written a program to read in this XFRM resource and call it. It looks like this: Handle theHandle; void (**pHand)(); main() { /* some initialization stuff (menus, windows) */ theHandle = GetResource('XFRM',1); HLock(theHandle); pHand = (void (**)())theHandle; (**pHand)(); HUnlock(theHandle); /* some other stuff */ } I use ResEdit to copy the XFRM resource from the compiled CODE resource file to the application project's resource file (the one that gets copied into the application after compilation). Here's where my second posting was wrong: The application works under UniFinder, but not under MultiFinder. The program works if I run it from within THINK C only if the source-level debugger option is on, but not otherwise. By 'works', I mean that the line is drawn in a window that was opened by the initialization stuff. By 'doesn't work', I mean that the program executes as expected, but doesn't draw the line. Could I have some stray pointers out there, boinking memory? The other possibility is that my typecasting is wrong (if you've seen my previous posts, the code has changed every time). Any help would be appreciated tremendously. At wit's end, rex Rexford A. Hill Washington University in St. Louis rah0777@wucec1.wustl.edu rex@dworkin.wustl.edu rex@wuccrc.wustl.edu