Get a CFStringRef from a constant string, we can use marco CFSTR(string). However that, "string" should be a string of text, not a const char* variable.
CFStringRef text = CFSTR("This is a sample"); // correct
const char* str = "This is a sample"; // error
CFStringRef text = CFSTR(str);
CFStringRef text = CFSTR("This is a sample"); // correct
const char* str = "This is a sample"; // error
CFStringRef text = CFSTR(str);