Archived

This topic is now archived and is closed to further replies.

Raistlin Majere

Folders and option to select them.

Recommended Posts

Hi I am having troubles to create a program that can go to a specific folder and read and writes files in there, how could I do that (the executable is in another folder). I am using c and opengl and glut library. Is there any way that with a right click you could select among the available folders. Any idea, thanks, Raistlin.

Share this post


Link to post
Share on other sites
If you want to read or write files to a certain folder you just need the path of the folder you want to write to. If you want the user of your program to be able to select the folder to read or write files to (visually), I would suggest using a dialog box. The simplest implementation is probably the CFileDialog box (MFC).

Share this post


Link to post
Share on other sites
You need to go into your project settings and set up the app to "Use MFC in a shared DLL". Then replace any "#include <windows.h>" with "#include <afxwin.h>"...Then, create an instance of a CFileDialog where you want...I don''t think I''m forgetting anything here as of now...

Share this post


Link to post
Share on other sites
1. right click on project in solution viewer.
2. select properties.
3. under "General"...go to the "Use of MFC" box ...choose "Use
MFC in a shared DLL".
4. read my previous post.

Share this post


Link to post
Share on other sites