Display of File Open Dialog Box in Win32 App in VC 6.0 
Author Message
 Display of File Open Dialog Box in Win32 App in VC 6.0

Hi

    My VC++ 6.0 is unable to identify the "OPENFILENAME" structure.
Plase help me what additional header file I should include.

My code is as follows :
----------

OPENFILENAME ofn;
memset(&ofn,0,sizeof(ofn));
ofn.lStructSize = sizeof(OPENFILENAME);
::GetOpenFileName(&ofn));

----------

Thanks.

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Mon, 12 Aug 2002 03:00:00 GMT  
 Display of File Open Dialog Box in Win32 App in VC 6.0
Why do you do it this way. Use a CFileDialog to do this.

CFileDialog dlg(TRUE,"*.txt");
dlg.DoModal();
AfxMessageBox(dlg.GetPathName());

This should work for you. David Pokluda

Quote:

> Organization: Deja.com - Before you buy.

> Newsgroups: microsoft.public.vc.mfc
> Date: Thu, 24 Feb 2000 23:42:19 GMT
> Subject: Display of File Open Dialog Box in Win32 App in VC 6.0

> Hi

> My VC++ 6.0 is unable to identify the "OPENFILENAME" structure.
> Plase help me what additional header file I should include.

> My code is as follows :
> ----------

> OPENFILENAME ofn;
> memset(&ofn,0,sizeof(ofn));
> ofn.lStructSize = sizeof(OPENFILENAME);
> ::GetOpenFileName(&ofn));

> ----------

> Thanks.

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Tue, 13 Aug 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Display of File Open Dialog Box in Win32 Application in VC++ 6.0

2. PBM: Message box not displayed after main dialog box is closed in MFC dialog-based app

3. Displaying multiple file extensions on Open Dialog Box

4. VC 5.0 app's open file dialog question

5. HOW TO Filter Files Without File Extention in Open File Dialog Box

6. Common Open Dialog not displaying a dialog when file doesn't exist

7. Disabling editing of list box items in the file open dialog box

8. How to display a Help button in a Open or Save As common dialog box

9. VC 6.0 and dialog boxes

10. vc++ 6.0 crashes when opening a file

11. changing the default file extension in the file open dialog box

12. Opening and displaying .jpg and .gif files in an MFC wizard generated app (VC++ 5.0)

 

 
Powered by phpBB® Forum Software