As this API call requires a CString, you need to convert the StringRef to one - use MCStringConvertToCString.