[Mono-osx] How to go from CFStringRef * to C# String

Larry Laffer gr at ice.no
Tue May 3 08:20:14 EDT 2011


I've recently started with Mono on OSX, and am a totally newbie in the OSX
development scene.

How do I get from a CFStringRef * to String?

I've tried this:

The PInvoke declaration is void MIDIOBjectGetStringProperty(uint hnd, IntPtr
propertyName, out IntPtr value);

The underlying CoreMIDI declaration is:
int MIDIObjectGetStringProperty(uint hnd, CFStringRef propertyName,
CFStringRef *value);

My code:

IntPtr myPtr = IntPtr.Zero;
int result = MIDIObjectGetStringProperty(handler, kMIDIPropertyName, out


At this point, myPtr has a value (pointing to 16 bytes in memory) this
probably points to a CFStringRef somwhere in memory...

How to get from here?

View this message in context: http://mono.1490590.n4.nabble.com/How-to-go-from-CFStringRef-to-C-String-tp3492333p3492333.html
Sent from the Mono - OSX mailing list archive at Nabble.com.

More information about the Mono-osx mailing list