Re: CFStringRef to cstring in c++?
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.