Re: CFStringRef to cstring in c++?
Re: CFStringRef to cstring in c++?
- Subject: Re: CFStringRef to cstring in c++?
- From: Richard Fox <email@hidden>
- Date: Tue, 24 Sep 2002 12:20:48 +1000
On Tuesday, September 24, 2002, at 12:04 PM, Gary Scavone wrote:
>
This is probably a stupid question, but I haven't found an answer in
>
my various searches.
>
>
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?
CFStringRef stringRef;
char cstring[64];
MIDIObjectGetStringProperty (dev, kMIDIPropertyModel, &stringRef);
CFStringGetCString (stringRef, cstring, sizeof(cstring), 0);
CFRelease (stringRef);
Check out
<
http://developer.apple.com/techpubs/macosx/CoreFoundation/
StringServices/String_Services/index.html> for the String Services
reference, there are different functions for getting the actual data or
making copies.
Cheers,
Richard
---
Richard Fox
LiveTime Software
_______________________________________________
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.