• 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
Re: CFStringRef to cstring in c++?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFStringRef to cstring in c++?


  • Subject: Re: CFStringRef to cstring in c++?
  • From: Bill Stewart <email@hidden>
  • Date: Tue, 24 Sep 2002 10:54:07 -0700

An interesting point to note here

You can search most of Apple's doc site using google.

Go to google.com

Search for
CFString

It comes up with links for docs on Apple's developer site

Bill

on 24/9/02 1:13 AM, robert wrote:

>> I just want to determine and print the names of the MIDI sources found by
>> the system. The MIDIObjectGetStringProperty() function returns the name
>> as a CFStringRef (which I learned is also a NSString *). What do I have
>> to do, in C++, to get the name in the form of a common C string?
>
> I use something along the following:
>
> CFStringRef pstr;
> char *value = (char *) malloc(512);
>
> MIDIObjectGetStringProperty(ref, propertyID, &pstr);
> CFStringGetCString(pstr, value, 512, 0);
> CFRelease(pstr);
>
> Ofcourse, you'll need to add some errorchecking and perhaps find a way to
> find out the length of the string in 'pstr'; the code above was just a
> quick-and-dirty hack :)
>
> robert
> _______________________________________________
> coreaudio-api mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/coreaudio-api
> Do not post admin requests to the list. They will be ignored.

--
mailto:email@hidden
tel: +1 408 974 4056

__________________________________________________________________________
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
__________________________________________________________________________
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: CFStringRef to cstring in c++? (From: robert <email@hidden>)

  • Prev by Date: Re: Discussion [MIDI USB X-Files Episode]
  • Next by Date: Re: AU2 - saying "no" to interleaved streams
  • Previous by thread: Re: CFStringRef to cstring in c++?
  • Next by thread: Re: CFStringRef to cstring in c++?
  • Index(es):
    • Date
    • Thread