GetOpenFileName doesn't work. 
Author Message
 GetOpenFileName doesn't work.

Hi,

I have this procedure:
void OpenFolder( HWND hDlg )
{
    TCHAR szFileName[ MAX_PATH ];
    TCHAR szPathName[MAX_PATH];
    _tcscpy( szPathName, _T("\\") );

    OPENFILENAME ofn; memset( &ofn, 0, sizeof( ofn ) );
    ofn.lStructSize = sizeof( ofn );
     ofn.hwndOwner = hDlg;
     ofn.lpstrFilter = _T("All files\0*.*\0");
     of.lpstrInitialDir  = szPathName;
    ofn.nFilterIndex = 1;
     ofn.lpstrFile = szFileName;
    ofn.nMaxFile = sizeof( szFileName )/sizeof(TCHAR);
     ofn.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST;
     if( GetOpenFileName( &ofn ) )
    {
    }

Quote:
}

example: OpenFolder( this->m_hWnd );

but it doesn't display my "root" folder or "windows" folder, only "my
documents" folder.
I don't know what it's wrong.
Can you help me?

Regards,

Rafael L.



Mon, 02 May 2005 02:49:47 GMT  
 GetOpenFileName doesn't work.
What is GetLastError returning?
Which OS?

--
~Demitri

(This posting is provided "AS IS" with no warranties, and confers no
rights.)


Quote:
> Hi,

> I have this procedure:
> void OpenFolder( HWND hDlg )
> {
>     TCHAR szFileName[ MAX_PATH ];
>     TCHAR szPathName[MAX_PATH];
>     _tcscpy( szPathName, _T("\\") );

>     OPENFILENAME ofn; memset( &ofn, 0, sizeof( ofn ) );
>     ofn.lStructSize = sizeof( ofn );
>      ofn.hwndOwner = hDlg;
>      ofn.lpstrFilter = _T("All files\0*.*\0");
>      of.lpstrInitialDir  = szPathName;
>     ofn.nFilterIndex = 1;
>      ofn.lpstrFile = szFileName;
>     ofn.nMaxFile = sizeof( szFileName )/sizeof(TCHAR);
>      ofn.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST;
>      if( GetOpenFileName( &ofn ) )
>     {
>     }
> }

> example: OpenFolder( this->m_hWnd );

> but it doesn't display my "root" folder or "windows" folder, only "my
> documents" folder.
> I don't know what it's wrong.
> Can you help me?

> Regards,

> Rafael L.



Mon, 02 May 2005 03:50:16 GMT  
 GetOpenFileName doesn't work.
I'm afraid that is the design on PocketPC if that is your
platform.
Quote:
>-----Original Message-----
>Hi,

>I have this procedure:
>void OpenFolder( HWND hDlg )
>{
>    TCHAR szFileName[ MAX_PATH ];
>    TCHAR szPathName[MAX_PATH];
>    _tcscpy( szPathName, _T("\\") );

>    OPENFILENAME ofn; memset( &ofn, 0, sizeof( ofn ) );
>    ofn.lStructSize = sizeof( ofn );
>     ofn.hwndOwner = hDlg;
>     ofn.lpstrFilter = _T("All files\0*.*\0");
>     of.lpstrInitialDir  = szPathName;
>    ofn.nFilterIndex = 1;
>     ofn.lpstrFile = szFileName;
>    ofn.nMaxFile = sizeof( szFileName )/sizeof(TCHAR);
>     ofn.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST;
>     if( GetOpenFileName( &ofn ) )
>    {
>    }
>}

>example: OpenFolder( this->m_hWnd );

>but it doesn't display my "root" folder or "windows"
folder, only "my
>documents" folder.
>I don't know what it's wrong.
>Can you help me?

>Regards,

>Rafael L.

>.



Mon, 02 May 2005 05:27:55 GMT  
 GetOpenFileName doesn't work.
I thought I read somewhere that the standard file box could not access above
"My Documents". Is that true? If not, how do you do it?

/john


Quote:
> What is GetLastError returning?
> Which OS?

> --
> ~Demitri

> (This posting is provided "AS IS" with no warranties, and confers no
> rights.)



> > Hi,

> > I have this procedure:
> > void OpenFolder( HWND hDlg )
> > {
> >     TCHAR szFileName[ MAX_PATH ];
> >     TCHAR szPathName[MAX_PATH];
> >     _tcscpy( szPathName, _T("\\") );

> >     OPENFILENAME ofn; memset( &ofn, 0, sizeof( ofn ) );
> >     ofn.lStructSize = sizeof( ofn );
> >      ofn.hwndOwner = hDlg;
> >      ofn.lpstrFilter = _T("All files\0*.*\0");
> >      of.lpstrInitialDir  = szPathName;
> >     ofn.nFilterIndex = 1;
> >      ofn.lpstrFile = szFileName;
> >     ofn.nMaxFile = sizeof( szFileName )/sizeof(TCHAR);
> >      ofn.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST;
> >      if( GetOpenFileName( &ofn ) )
> >     {
> >     }
> > }

> > example: OpenFolder( this->m_hWnd );

> > but it doesn't display my "root" folder or "windows" folder, only "my
> > documents" folder.
> > I don't know what it's wrong.
> > Can you help me?

> > Regards,

> > Rafael L.



Sat, 06 Aug 2005 18:16:38 GMT  
 GetOpenFileName doesn't work.
GetOpenFileName can not browse above My Computer ("\"). The code snippet
provided should work except that szFileName should be initialized to the
null string before being passed into the function.

--
Jan Karachale
Windows CE .NET Shell

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. ? 2001 Microsoft Corporation. All rights
reserved.


Quote:
> I thought I read somewhere that the standard file box could not access
above
> "My Documents". Is that true? If not, how do you do it?

> /john



> > What is GetLastError returning?
> > Which OS?

> > --
> > ~Demitri

> > (This posting is provided "AS IS" with no warranties, and confers no
> > rights.)



> > > Hi,

> > > I have this procedure:
> > > void OpenFolder( HWND hDlg )
> > > {
> > >     TCHAR szFileName[ MAX_PATH ];
> > >     TCHAR szPathName[MAX_PATH];
> > >     _tcscpy( szPathName, _T("\\") );

> > >     OPENFILENAME ofn; memset( &ofn, 0, sizeof( ofn ) );
> > >     ofn.lStructSize = sizeof( ofn );
> > >      ofn.hwndOwner = hDlg;
> > >      ofn.lpstrFilter = _T("All files\0*.*\0");
> > >      of.lpstrInitialDir  = szPathName;
> > >     ofn.nFilterIndex = 1;
> > >      ofn.lpstrFile = szFileName;
> > >     ofn.nMaxFile = sizeof( szFileName )/sizeof(TCHAR);
> > >      ofn.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST;
> > >      if( GetOpenFileName( &ofn ) )
> > >     {
> > >     }
> > > }

> > > example: OpenFolder( this->m_hWnd );

> > > but it doesn't display my "root" folder or "windows" folder, only "my
> > > documents" folder.
> > > I don't know what it's wrong.
> > > Can you help me?

> > > Regards,

> > > Rafael L.



Tue, 23 Aug 2005 06:27:53 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. GetOpenFileName() doesn't work under Windows XP???

2. GetOpenFileName() doesn't work under Windows XP???

3. GetOpenFileName() doesn't appear

4. SaveBarState (WORKS) LoadBarState(Doesn't Work)?

5. GetPrivateProfileSectionNames works in 2000, doesn't work in 98 or ME

6. Tooltip works and then doesn't work

7. Q147740 CWnd work-around doesn't work with control that uses lic file

8. Calling ADO's GetRows() from VC doesn't work

9. Don't know why this doesn't work, but

10. TERMWAIT Win 3.1 sample doesn't work under '95

11. Wht Doesn't This File download Work?

12. Sort doesn't work on bound data

 

 
Powered by phpBB® Forum Software