Re: WinFileDlg problem
- From: Lars Erdmann <lars.erdmann@xxxxxxxx>
- Date: Tue, 13 Dec 2005 09:58:01 +0100
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 .
- Follow-Ups:
- Re: WinFileDlg problem
- From: ML
- Re: WinFileDlg problem
- References:
- WinFileDlg problem
- From: ML
- WinFileDlg problem
- Prev by Date: Re: object id of autostart folder
- Next by Date: Re: WinDlgBox
- Previous by thread: Re: WinFileDlg problem
- Next by thread: Re: WinFileDlg problem
- Index(es):
Relevant Pages
|
Loading