It's not the version of PellesC, try this function, it works here when debugging.
int Picture_Select(HWND hWnd)
{
OPENFILENAMEW ofn ;
wchar_t szTmpFileName[MAX_PATH] ;
wchar_t szPictureFileFilters[] = {L"TEXT Files\0*.txt\0\0"};
ZeroMemory(&ofn,sizeof(ofn)) ;
ZeroMemory(szTmpFileName,sizeof(szTmpFileName)) ;
ofn.lStructSize = sizeof(ofn) ;
ofn.hwndOwner = hWnd ;
ofn.lpstrFilter = (wchar_t *) szPictureFileFilters;
ofn.lpstrFile = szTmpFileName ;
ofn.nMaxFile = MAX_PATH ;
ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY ;
if(GetOpenFileNameW(&ofn))
return 1;
else
return 0;
}
John