Re: NSString from Carbon by AppleEvent
Re: NSString from Carbon by AppleEvent
- Subject: Re: NSString from Carbon by AppleEvent
- From: Jim Correia <email@hidden>
- Date: Thu, 29 May 2003 17:53:16 -0400
On Thursday, May 29, 2003, at 02:04 PM, John Nairn wrote:
1. Create Apple Event to call Cocoa app
2. Convert Pascal string to CFString with
CFStringRef
argRef=CFStringCreateWithPascalString(NULL,myArg,kCFStringEncodingMacRo
man);
3. Turn CFString into AEDesc and add as parameter to AppleEvent (this
is NOT working)
[...]
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?
If you already have a pascal string and you know its encoding (which
seems to be the case) you don't need to create a CFString before
putting it in the apple event. Actually, this creates more work for you
since you can't put the CFString directly into an apple event, but must
first extract the characters.
You don't say how you implemented step 3, and surely this is the
problem.
What did you do? Until you say, we cannot tell you where you went
wrong. (I could post an example first, but that may not obviously
illustrate the flaw in your approach.)
Jim
_______________________________________________
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.