Board index » delphi » Apple Events For Macintosh

Apple Events For Macintosh

I'm using THINK Pascal 4.0 on an Apple Macintosh. But I'm happy for you
to send me C or Codewarrior Code. I have managed to successfully send,
create & receive a custom Apple Event. But I am having trouble getting
the server to return a custom Apple Event without making him select the
client in the Program Linking dialog.

This is how I'm doing it at the moment :

1. The client selects himself in Program Linking dialog and then in a
separate Program Linking dialog selects a server the client's
PortInfoRec and his TargetID from the first Program Linking dialog are
then inserted into the custom Apple Event (this works fine.)  

2. The client computer then sends a string "HI" along with his
PortInfoRec and TargetID to the server (this also works fine)

3. The server then receives the custom Apple Event and registers it with
my program (this also works fine.)

4. Then using the PortInfoRec and TargetID given through the Apple Event
the server tries to resend it. This doesn't work, and I believe it is
because the PortInfoRec and TargetID have special information about the
computer that it is sent on and that information is non transferable.

I've tried many other things but all have failed. And could you please
read the following requests:

? I don't want to start a PPC Session because I need to talk to more
than one client.

? I would be happy to change what the custom event sends so it might
send an address that I can work off rather than the TargetID

? I would rather the server know where the client is without getting him
to select the client in the Program Linking dialog.

? I know about replies. (For example : one computer sends an Apple Event
then the Server places something inside the reply section of the event
and sends it back) But I don't want to use these because they're not
flexible enough.

Thanks in advance,
Mark Pazolli             <pazol...@cygnus.uwa.edu.au>    

 

Re:Apple Events For Macintosh


Hi Mark,
        It is hard to say what exactly went wrong without looking at the code.
But this would be a consulting question.
        You might just want to check the following :
1. set the appropriate flags in its 'SIZE' resource
2. test for high-level events in its event loop
3. provide Apple event handlers for the Apple events it supports
4. use the AEInstallEventHandler function to install its Apple event
handlers
5. use the AEProcessAppleEvent function to process Apple events
6. Does the server allow for remote linking in the Sharing setup?

Kevin Quah
Symantec Corp.
Internet Tools Technical Support

Quote
Mark wrote:

> I'm using THINK Pascal 4.0 on an Apple Macintosh. But I'm happy for you
> to send me C or Codewarrior Code. I have managed to successfully send,
> create & receive a custom Apple Event. But I am having trouble getting
> the server to return a custom Apple Event without making him select the
> client in the Program Linking dialog.

> This is how I'm doing it at the moment :

> Thanks in advance,
> Mark Pazolli             <pazol...@cygnus.uwa.edu.au>

Other Threads