From: Guido Franzke on
Hello NG,

I see a strange behaviour of CFileDialog on some, but not all computers.
When I open a dialog in Windows XP with

static char hFilter[] = "jpg Files (*.jpg,*.jpeg)|*.jpg;*.jpeg|All Files
(*.*)|*.*||";
CFileDialog fdlg(TRUE, "", "",OFN_FILEMUSTEXIST| OFN_HIDEREADONLY,
hFilter, this);
if (fdlg.DoModal() == IDOK) ...

When I press left on "My Computer", the file list don't show files and
directories. But there are e.g drives and network drives. When I press "My
documents" the file and directory list is shown correctly.

Even when I swap the filter definitions to
static char hFilter[] = "All Files (*.*)|*.*|jpg Files
(*.jpg,*.jpeg)|*.jpg;*.jpeg||";
the "My Computer" does not show anything.

Why is it?

Thanks for help,
Guido


From: AliR on
My Computer only lists drives that are connected to your computer, it does
not contain any files or folders.

Does it display files when you select C drive for example?

AliR.

"Guido Franzke" <guidof73(a)yahoo.de> wrote in message
news:OXfGyusNKHA.3588(a)TK2MSFTNGP05.phx.gbl...
> Hello NG,
>
> I see a strange behaviour of CFileDialog on some, but not all computers.
> When I open a dialog in Windows XP with
>
> static char hFilter[] = "jpg Files (*.jpg,*.jpeg)|*.jpg;*.jpeg|All Files
> (*.*)|*.*||";
> CFileDialog fdlg(TRUE, "", "",OFN_FILEMUSTEXIST| OFN_HIDEREADONLY,
> hFilter, this);
> if (fdlg.DoModal() == IDOK) ...
>
> When I press left on "My Computer", the file list don't show files and
> directories. But there are e.g drives and network drives. When I press "My
> documents" the file and directory list is shown correctly.
>
> Even when I swap the filter definitions to
> static char hFilter[] = "All Files (*.*)|*.*|jpg Files
> (*.jpg,*.jpeg)|*.jpg;*.jpeg||";
> the "My Computer" does not show anything.
>
> Why is it?
>
> Thanks for help,
> Guido
>
>


From: Guido Franzke on
The list field is empty. There are no drives, although I have harddisks and
net drives. When I open e.g. in notepad, I can see the same CFileDialog, but
here the My Computer drives are all shown.
Why they are not shown in my CFileDialog? I can only select my drive with
the combobox on top, when I select there, all drives and files/dirs are
shown everywhere (e.g. in C: system)

Do you know why in "My Computer" nothing is shown?



"AliR" <AliR(a)online.nospam> schrieb im Newsbeitrag
news:uAHrwitNKHA.3192(a)TK2MSFTNGP05.phx.gbl...
> My Computer only lists drives that are connected to your computer, it does
> not contain any files or folders.
>
> Does it display files when you select C drive for example?
>
> AliR.
>
> "Guido Franzke" <guidof73(a)yahoo.de> wrote in message
> news:OXfGyusNKHA.3588(a)TK2MSFTNGP05.phx.gbl...
> > Hello NG,
> >
> > I see a strange behaviour of CFileDialog on some, but not all computers.
> > When I open a dialog in Windows XP with
> >
> > static char hFilter[] = "jpg Files (*.jpg,*.jpeg)|*.jpg;*.jpeg|All
Files
> > (*.*)|*.*||";
> > CFileDialog fdlg(TRUE, "", "",OFN_FILEMUSTEXIST| OFN_HIDEREADONLY,
> > hFilter, this);
> > if (fdlg.DoModal() == IDOK) ...
> >
> > When I press left on "My Computer", the file list don't show files and
> > directories. But there are e.g drives and network drives. When I press
"My
> > documents" the file and directory list is shown correctly.
> >
> > Even when I swap the filter definitions to
> > static char hFilter[] = "All Files (*.*)|*.*|jpg Files
> > (*.jpg,*.jpeg)|*.jpg;*.jpeg||";
> > the "My Computer" does not show anything.
> >
> > Why is it?
> >
> > Thanks for help,
> > Guido
> >
> >
>
>


From: AliR on
Your call to CFileDialog looks fine, I presonally wouldn't use a static
variable for the filter string, but other than that it looks fine.

AliR.


"Guido Franzke" <guidof73(a)yahoo.de> wrote in message
news:ecjTJrtNKHA.3552(a)TK2MSFTNGP04.phx.gbl...
> The list field is empty. There are no drives, although I have harddisks
> and
> net drives. When I open e.g. in notepad, I can see the same CFileDialog,
> but
> here the My Computer drives are all shown.
> Why they are not shown in my CFileDialog? I can only select my drive with
> the combobox on top, when I select there, all drives and files/dirs are
> shown everywhere (e.g. in C: system)
>
> Do you know why in "My Computer" nothing is shown?
>
>
>
> "AliR" <AliR(a)online.nospam> schrieb im Newsbeitrag
> news:uAHrwitNKHA.3192(a)TK2MSFTNGP05.phx.gbl...
>> My Computer only lists drives that are connected to your computer, it
>> does
>> not contain any files or folders.
>>
>> Does it display files when you select C drive for example?
>>
>> AliR.
>>
>> "Guido Franzke" <guidof73(a)yahoo.de> wrote in message
>> news:OXfGyusNKHA.3588(a)TK2MSFTNGP05.phx.gbl...
>> > Hello NG,
>> >
>> > I see a strange behaviour of CFileDialog on some, but not all
>> > computers.
>> > When I open a dialog in Windows XP with
>> >
>> > static char hFilter[] = "jpg Files (*.jpg,*.jpeg)|*.jpg;*.jpeg|All
> Files
>> > (*.*)|*.*||";
>> > CFileDialog fdlg(TRUE, "", "",OFN_FILEMUSTEXIST| OFN_HIDEREADONLY,
>> > hFilter, this);
>> > if (fdlg.DoModal() == IDOK) ...
>> >
>> > When I press left on "My Computer", the file list don't show files and
>> > directories. But there are e.g drives and network drives. When I press
> "My
>> > documents" the file and directory list is shown correctly.
>> >
>> > Even when I swap the filter definitions to
>> > static char hFilter[] = "All Files (*.*)|*.*|jpg Files
>> > (*.jpg,*.jpeg)|*.jpg;*.jpeg||";
>> > the "My Computer" does not show anything.
>> >
>> > Why is it?
>> >
>> > Thanks for help,
>> > Guido
>> >
>> >
>>
>>
>
>


From: Tom Serface on
I agree with Ali, at first glance this looks OK. Have you tried doing it
without the filter to see if that sort of fixes the problem (I.E., you see
everything OK with no filter)? Then you may want to try just assigning it
to a CString instead, or better yet, put it in your resource table and load
it from there so if you ever want to internationalize you can change the
words like "Files and All Files" without any difficulty (that's not the
issue, just a free tip).

I do this sort of thing all the time and I don't have any problems getting
it to work, but I've never done the filter this way so that why I am
suspicious. It would be easy to try doing it with no filter (or the filter
embedded in the call instead of a variable) to see if that causes any
difference.

Tom

"Guido Franzke" <guidof73(a)yahoo.de> wrote in message
news:OXfGyusNKHA.3588(a)TK2MSFTNGP05.phx.gbl...
> Hello NG,
>
> I see a strange behaviour of CFileDialog on some, but not all computers.
> When I open a dialog in Windows XP with
>
> static char hFilter[] = "jpg Files (*.jpg,*.jpeg)|*.jpg;*.jpeg|All Files
> (*.*)|*.*||";
> CFileDialog fdlg(TRUE, "", "",OFN_FILEMUSTEXIST| OFN_HIDEREADONLY,
> hFilter, this);
> if (fdlg.DoModal() == IDOK) ...
>
> When I press left on "My Computer", the file list don't show files and
> directories. But there are e.g drives and network drives. When I press "My
> documents" the file and directory list is shown correctly.
>
> Even when I swap the filter definitions to
> static char hFilter[] = "All Files (*.*)|*.*|jpg Files
> (*.jpg,*.jpeg)|*.jpg;*.jpeg||";
> the "My Computer" does not show anything.
>
> Why is it?
>
> Thanks for help,
> Guido
>
>