• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSString from Carbon by AppleEvent
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSString from Carbon by AppleEvent


  • Subject: NSString from Carbon by AppleEvent
  • From: John Nairn <email@hidden>
  • Date: Thu, 29 May 2003 12:04:00 -0600

In follow-up to previous question, I am close to sending AppleEvent from Carbon to Cocoa by guessing. I can create an event and send it to my Cocoa app and it gets there fine if I add no parameters (the one NSString parameter is defined as optional). If I try to add NSString to AppleEvent the event never gets to Cocoa app (and no errors from any AppleEvent calls).

The only question, therefore, is how to add an argument to an AppleEvent in Carbon that needs to be an NSString object when it gets to Cocoa app. Here is code flow

1. Create Apple Event to call Cocoa app

2. Convert Pascal string to CFString with

CFStringRef argRef=CFStringCreateWithPascalString(NULL,myArg,kCFStringEncodingMacRom an);

3. Turn CFString into AEDesc and add as parameter to AppleEvent (this is NOT working)

4. Send the AppleEvent

If step 3 is omitted, everything else works (but no argument is passed). All attempts at inserting the parameter have failed. One simple problem which I am sure anyone using AppleEvents from Carbon to Cocoa must know how to do?

------------
John Nairn (1-801-581-3413, FAX: 1-801-581-4816)
Web page: http://www.mse.utah.edu/~nairn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSString from Carbon by AppleEvent
      • From: Jim Correia <email@hidden>
  • Prev by Date: Re: NSMatrix hangs in mouse tracking?
  • Next by Date: Re: Getting Application Path
  • Previous by thread: Re: NSMatrix hangs in mouse tracking?
  • Next by thread: Re: NSString from Carbon by AppleEvent
  • Index(es):
    • Date
    • Thread