Nick;

Thanks for the info, the deal is I don't have access to the source for 'initSomeSystem'. So I can't answer your question, other than to point out what does work..
I do know that ' #define kVersion "abc" ' creates a suitable string.

I'm trying to do the 'best' substitution I can with the fact that I have an NSString and no access to the called method.

Hence my original question as the result of a #define x "123" being a 'char*'.
If that is true, then is the following the best solution?

        #define kVERSION "abc"
        NSString * partNumber = [[blah blah] moreBlah];
.....
const char * cPartNumber = [partNumber cStringUsingEncoding:NSUTF8StringEncoding];
        if( (p_flag = initSomeSystem (
                                        kVERSION,                       
                                        (char *) cPartNumber,
                                        &errorCode))
                   == NULL) { ....

Thanks,
Steve

On May 11, 2008, at 12:59 PM, Nick Zitzmann wrote:


On May 11, 2008, at 11:36 AM, Steve Cronin wrote:

Is this correct?
Is there a better way?


It depends. Does the code take a real C string (char array), or does it take an Str63 or Str255 or something? If the latter, then you need to use CoreFoundation to get a Pascal string from the NSString.

Nick Zitzmann
<http://www.chronosnet.com/>





_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to