rem: dialogOptions.message = CFStringCreateWithCString(NULL,message,CFStringGetSystemEncoding());
add: dialogOptions.message = wxCFString(message);
context: char *wxFileSelector(char *message, char *default_path,                     char *default_filename, char *default_extension,                     char *wildcard, int flags,                     wxWindow *parent, int x, int y){  if ((navinited >= 0) && (navinited || NavServicesAvailable())) {    NavDialogRef outDialog;    OSErr derr;    NavDialogCreationOptions dialogOptions;    wxCallbackInfo *cbi;    NavUserAction action;    NavReplyRecord *reply;    char *temp;    if (!navinited) {      if (!NavLoad()) {	navinited = 1;      } else {	navinited = -1;	return wxFileSelector(message, default_path, default_filename,			      default_extension, wildcard, flags,			      parent, x, y);      }     }    cbi = new wxCallbackInfo();    cbi->initial_directory = default_path;    cbi->force_extension = NULL;    NavGetDefaultDialogCreationOptions(&dialogOptions);    if (default_filename)  {      dialogOptions.saveFileName = CFStringCreateWithCString(NULL,default_filename,CFStringGetSystemEncoding());    }    if (message) {      dialogOptions.message = CFStringCreateWithCString(NULL,message,CFStringGetSystemEncoding());    }    dialogOptions.modality = kWindowModalityAppModal;    if (flags & wxBUNDLES_ENTER)      dialogOptions.optionFlags |= (kNavSupportPackages | kNavAllowOpenPackages);    if (flags & wxBUNDLES_OK)      dialogOptions.optionFlags |= kNavSupportPackages;    if (!(flags & wxMULTIOPEN))      dialogOptions.optionFlags -= (dialogOptions.optionFlags & kNavAllowMultipleFiles);    if (cbi->force_extension)      dialogOptions.optionFlags |= kNavDontConfirmReplacement;#ifdef OS_X    if (parent) {      wxFrame *f;      if (wxSubType(parent->__type, wxTYPE_FRAME)) {	f = (wxFrame *)parent;      } else if (wxSubType(parent->__type, wxTYPE_DIALOG_BOX)) {	f = (wxFrame *)parent->GetParent();      } else	f = NULL;      if (f)	f = f->GetSheetParent();      if (f) {	CGrafPtr graf;	wxMacDC *mdc;	mdc = f->MacDC();	graf = mdc->macGrafPort();	dialogOptions.parentWindow = GetWindowFromPort(graf);	dialogOptions.modality = kWindowModalityWindowModal;      }    }#endif    // create the dialog:    if (flags & wxGETDIR) {      derr = NavCreateChooseFolderDialog(&dialogOptions,					 extProc, NULL, cbi, 					 &outDialog);    } else if ((flags == 0) || (flags & wxOPEN) || (flags & wxMULTIOPEN)) {      derr = NavCreateGetFileDialog(&dialogOptions, NULL,				    extProc, NULL, NULL, cbi, 				    &outDialog);    } else {      derr = NavCreatePutFileDialog(&dialogOptions, 'TEXT', 'mReD',				    extProc, cbi,				    &outDialog);    }    if (derr != noErr) {      if (default_filename) 	CFRelease(dialogOptions.saveFileName);      if (message)	CFRelease(dialogOptions.message);      return NULL;    }    wxPrimDialogSetUp();    // run the dialog (AppModal doesn't return until user closes dialog):    if (NavDialogRun(outDialog) != noErr) {      if (default_filename)	CFRelease(dialogOptions.saveFileName);      if (message)	CFRelease(dialogOptions.message);      NavDialogDispose(outDialog);      wxTheApp->AdjustCursor();      return NULL;    }        if (dialogOptions.modality != kWindowModalityAppModal) {      RunAppModalLoopForWindow(NavDialogGetWindow(outDialog));    }    wxPrimDialogCleanUp();        // dump those strings:    if (default_filename)      CFRelease(dialogOptions.saveFileName);    if (message)      CFRelease(dialogOptions.message);        // did the user cancel?:    action = NavDialogGetUserAction(outDialog);    if ((action == kNavUserActionCancel) || (action == kNavUserActionNone)) {      NavDialogDispose(outDialog);      return NULL;    }        // get the user's reply:#ifdef MZ_PRECISE_GC    reply = (NavReplyRecord *)GC_malloc_atomic(sizeof(NavReplyRecord));#else    reply = new NavReplyRecord;#endif    if (NavDialogGetReply(outDialog,reply) != noErr) {      NavDialogDispose(outDialog);      return NULL;    }    NavDialogDispose(outDialog);    if (! reply->validRecord) {      NavDisposeReply(reply);      return NULL;    }        if (flags & wxMULTIOPEN) {      long count, index;      char *newpath, *aggregate = "";      OSErr err;            err = AECountItems(&(reply->selection),&count);      if (err != noErr) {        NavDisposeReply(reply);        return NULL;      }            for (index=1; index<=count; index++) {	temp = GetNthPath(reply, index);        if (temp != NULL) {	  long size;	  size = (strlen(aggregate) 		  + strlen(temp)		  + log_base_10(strlen(temp)) + 3);          newpath = new WXGC_ATOMIC char[size];          sprintf(newpath,"%s %ld %s",aggregate,strlen(temp),temp);          aggregate = newpath;        }      }            NavDisposeReply(reply);            return aggregate;    } else if ((flags & wxOPEN) || (flags & wxGETDIR)) {      char *path;      path = GetNthPath(reply, 1);      NavDisposeReply(reply);      return path;    } else { // saving file      int strLen;      char *filename;      char *path, *wholepath;      strLen = (6 * CFStringGetLength(reply->saveFileName)) + 1;      filename = new char[strLen];      if (CFStringGetCString(reply->saveFileName,filename,strLen,kCFStringEncodingUTF8) == FALSE) {	// Unable to convert string	NavDisposeReply(reply);	return NULL;      }      path = GetNthPath(reply, 1);            if (path == NULL) {	NavDisposeReply(reply);	return NULL;      }            wholepath = new WXGC_ATOMIC char[strlen(path) + strlen(filename) + 2];            sprintf(wholepath,"%s" PATH_SEPARATOR "%s",path,filename);            NavDisposeReply(reply);            return wholepath;    }  } else    return NULL;}