Newsgroups: comp.lang.dylan
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!news.mathworks.com!newsfeed.internetmci.com!newsxfer2.itd.umich.edu!howland.erols.net!vixen.cso.uiuc.edu!uchinews!jbd2
From: jbd2@midway.uchicago.edu (Brad Dominy)
Subject: Help with API...
X-Nntp-Posting-Host: ellis-nfs.uchicago.edu
Message-ID: <Dw4v47.301@midway.uchicago.edu>
Sender: news@midway.uchicago.edu (News Administrator)
Organization: The University of Chicago
Date: Wed, 14 Aug 1996 15:02:31 GMT
Lines: 45

Hi Everyone,
   Like most people, I have been playing around with Apple Dylan for the 
last few months, and I must say that I really enjoy using it. This is 
actually my first real attempt at learning how to program for the Mac and
Dylan has made this much easier than my previous attempts. However, I have
just run into a snag which I can't figure out. 
   Here is the situation. I am playing with Creole and trying to import
the Webstar API 1.0. For most things, it imports just fine but there are a
few places in the WSAPI.h file that Dylan can't deal with. Specifically,

typedef struct {
	AppleEvent theAppleEvent;
	AppleEvent reply;
	long handlerRefcon;
} WSAPI_IPC_Result, *WSAPI_IPC_ResultPtr;

Now, with my limited understanding of C and Dylan I know this is a struct 
which should be imported into a Dylan Class object. The error I get when I
try to parse this is:

Parse error: theAppleEvent where ";", ",", "...", or ")" expected after 
declaration
Last position read in My_HD:Programming:Dylan:Projects:WebStar:WSAPI.h is 
10730:
 
The reason for this, as far as I can tell is that Dylan doesn't know what the
type 'AppleEvent' is. Now, I have tried to provide an explicit type mapping in
Dylan, but things get very fuzzy, very quickly for me when I do this. My Dylan
code is:

define interface
  #include "WSAPI.h",
     import: {"WSAPI_IPC_Result"},
     CFM-library: "WSAPI_Framework(PPC).lib",
     type: {"AppleEvent" => <apple-event>};
end interface;

and I have tried different classes. My suspicion is that I don't have the 
class set up correctly to accept the AppleEvent type, but I don't know how
to do this. Could anyone give me some pointers?

Thanks,
Brad Dominy


