Re: WinFileDlg problem



ML schrieb:
Once I had WinFileDlg() in working order with the multiple_files-option
enabled, but I actually want to process one file each time. Depending on
what I try without that option, the app just seems to crash without any
error message, or it returns NULL. :-(

When there's one file selected (and selectable), how do I get access to
that file name?

Here's what I hoped would work, but it fails, and I don't know why (no
need to explain, I just want something that works :-)):

     hwndDlg=WinFileDlg(HWND_DESKTOP,HWND_DESKTOP,&fild);

     if (hwndDlg&&(fild.lReturn==DID_OK))
          {
          sprintf(filename,"%s",*(fild.papszFQFilename)[0]);



---

I think it's:

        if (hwndDlg && (fild.lReturn==DID_OK))
        {
            ...
            if (fild.papszFQFilename)
            {
	            for (i=0;i<fild.ulFQFCount;i++)
        	    {	
			sprintf(filename,"%s",fild.papszFQFilename[i]);
		    }
		    WinFreeFileDlgList(fild.papszFQFilename);
	     }
             else
             {
                  /* user hacked in name of the (one) file directly */
                  ...
                  sprintf(filename,"%s",fild.szFullFile);
             }
         }

Lars
.



Relevant Pages

  • Re: change progressbar bar color
    ... "iwdu15" schrieb: ... from blue to any other system color? ... depending on a variable in my app. ...
    (microsoft.public.dotnet.languages.vb)
  • Repeatable hard crash with 2.6.0.test[123]
    ... One application will reliably cause the system to crash when it exits ... This app worked fine and exited correctly ... the few changes needed to get the 2.kernels running. ... # ACPI Support ...
    (Linux-Kernel)
  • Re: IOCP critical sections and mutexes
    ... instance) and I get pretty much the same crash. ... I mush have done something stupid in my main thread app. ... My packets never go over 2k in size. ... If I use a mutex instead it works fine. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: IOCP critical sections and mutexes
    ... mismatch and invalid 'this' pointer). ... instance) and I get pretty much the same crash. ... I mush have done something stupid in my main thread app. ... If I use a mutex instead it works fine. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Bizarre (at least to me) behavior
    ... Or at least simplify the code as much as possible, then please send me the generated assembly listing for dlgClass::dlgClassas well as the full callstack at the point of the crash. ... I built this app and the OS image for a PCM5320 from Advantech. ... What is really bizarre is that if I just hover the mouse over the variable in the debugger I get the fault. ... Below is a code snippet to illustrate. ...
    (microsoft.public.windowsce.embedded.vc)

Loading