NO

Author Topic: GetOpenFileName Problem  (Read 4258 times)

jasch212

  • Guest
GetOpenFileName Problem
« on: March 14, 2010, 03:47:43 PM »
hello,

i use the following code to open a file (by user request)

WCHAR wszFile[MAX_PATH] = L"\0";
OPENFILENAME ofn = {0};
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hwnd;
ofn.lpstrFile = wszFile;
ofn.nMaxFile = MAX_PATH;
ofn.lpstrFilter = L"All\0*.*\0Text\0*.TXT\0";//L"All (*.*)\0*.*\0";
ofn.lpstrTitle = L"Open GPX File";
ofn.Flags =  OFN_EXPLORER | OFN_NOCHANGEDIR;
   ofn.lpstrInitialDir = NULL;

   if (GetOpenFileName(&ofn))
         ShowInfo(hwnd, ofn.lpstrFile);

in the openMenue i cound't change the directory to myStorageCard???
and i see not all directorys.

anyone a hint.
Thomas

Kaljj

  • Guest
Re: GetOpenFileName Problem
« Reply #1 on: April 07, 2010, 08:57:41 PM »
Hello Thomas,

I don't know why you can't see/change all directorys.
I found only two little Erros in your structur.
1) the lpstrFilter must closed with "\0\0" (double NULL)
2) Both "ofn.Flags" are not supported in Windows CE
I hope if you change this, its work fine.

Bye Kaljj

jasch212

  • Guest
Re: GetOpenFileName Problem
« Reply #2 on: April 08, 2010, 10:11:35 AM »
OK thanks Kaljj,
double NULL was the Problem.

Bye thomas