// creates as temp file, then spawns notepad with it... // static bool SendStringToNotepad(LPCSTR psWhatever, LPCSTR psLocalFileName) { bool bReturn = false; LPCSTR psOutputFileName = va("c:\\%s",psLocalFileName); FILE *handle = fopen(psOutputFileName,"wt"); if (handle) { fprintf(handle,"%s",psWhatever); // NOT fprintf(handle,psWhatever), which will try and process built-in %s stuff fclose(handle); bReturn = SendFileToNotepad(psOutputFileName); } else { assert(0);//ErrorBox(va("Unable to create file \"%s\" for notepad to use!",psOutputFileName)); } return bReturn; }
// creates as temp file, then spawns notepad with it... // bool SendStringToNotepad(LPCSTR psWhatever, LPCSTR psLocalFileName) { bool bReturn = false; LPCSTR psOutputFileName = va("%s\\%s",scGetTempPath(),psLocalFileName); FILE *handle = fopen(psOutputFileName,"wt"); if (handle) { fprintf(handle,psWhatever); fclose(handle); bReturn = SendFileToNotepad(psOutputFileName); } else { ErrorBox(va("Unable to create file \"%s\" for notepad to use!",psOutputFileName)); } return bReturn; }