You can use ep.copyasstringref() here (into an appropriate MCAutoStringRef)... Also means you can pass the stringref into MCStringFOrmat below (no need to getcstring).