Click here to Skip to main content
15,883,883 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello
i have created dialog based MFC application with VS 2012 and want to open a text file window without the user having to browse it just like when we click a file it opens similarly in my application text file must be open when button is clicked.

thanks
Posted
Comments
Jochen Arndt 30-Jan-15 5:29am    
So what is your problem?
The general procedure may be:
- Add a handler when the button is clicked
- In the handler create a dialog containing an edit control
- In that dialog load the file content into the edit control
- Optionally pass the file name to the dialog

1 solution

You need to register your application with the Windows Shell so that the specific file types are associated with your application. See https://msdn.microsoft.com/en-us/library/windows/desktop/hh127451%28v=vs.85%29.aspx[^].
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900