Sorry for asking so many questions.
What am I doing wrong here?
This snippet is in my WndProc function.
The code compiles, but nothing gets saved.
I was looking for a WinCE-specific example, but haven't found anything.
I'm guessing it's another unicode vs. ASCII issue?
Thanks.
What am I doing wrong here?
This snippet is in my WndProc function.
The code compiles, but nothing gets saved.
I was looking for a WinCE-specific example, but haven't found anything.
I'm guessing it's another unicode vs. ASCII issue?
Thanks.
- Code:
FILE* textfile=NULL;
LRESULT lResult = TRUE;
TCHAR szFile[MAX_PATH] = TEXT("\0");
OPENFILENAME ofn;
memset(&(ofn), 0, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hwnd;
ofn.lpstrFile = szFile;
ofn.nMaxFile = MAX_PATH;
case ID_FILE_SAVEAS:
ofn.lpstrFilter = TEXT("Text(*.txt)\0*.txt\0");
ofn.lpstrTitle = TEXT("Save File As");
ofn.Flags = OFN_HIDEREADONLY;
ofn.lpstrDefExt = TEXT("txt");
if (GetSaveFileName(&ofn))
{
ShowInfo(hwnd,ofn.lpstrFile);
textfile=fopen((LPSTR)ofn.lpstrFile,"w");
if(!textfile) return -1;
fprintf(textfile, "TEST!\n");
}
break;