Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!dg!dg-webo.dg.com!bkahn From: bkahn@archive.webo.dg.com (Bruce Kahn) Newsgroups: comp.sys.apple2 Subject: Q: Orca/C and p2cstr() Keywords: C, Orca/C Message-ID: <1020@dg.dg.com> Date: 4 Oct 90 14:51:25 GMT Sender: root@dg.dg.com Reply-To: bkahn@archive.webo.dg.com (Bruce Kahn) Organization: Data General Corporation, Westboro, MA Lines: 27 Ive been trying to finalize some changes to a desktop program Im creating and have found an oddity w/Orca/C (or so I think). After returning from a call to SFGetFile(), I check replyPtr->good and if its TRUE, I attempt to open the file in replyPtr->filename. Since Im writing in C and replyPtr->filename is a Pascal string, I tried to use the following (w/SFReplyPtr replyPtr;): fp = fopen(p2cstr(replyPtr->filename,"wb")); but that didnt work. I then tried: fp = fopen(p2cstr(&replyPtr->filename,"wb")); but that also failed. In my frustration, I dumped the output of p2cstr(replyPtr->filename) and p2cstr(&replyPtr->filename) to a log file and got basically garbage or random junk. I hacked my own p2cstr() for doing an in-place conversion and things work just fine. Can anyone tell me why p2cstr didnt work for me or is there a known bug w/p2cstr?? -- Bruce (bkahn@archive.webo.dg.com or kahn@adam.dg.com) Standard disclaimers apply, except where prohibited by law...