Click here to Skip to main content
15,928,582 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Main Arguments Pin
toxcct8-May-07 13:37
toxcct8-May-07 13:37 
GeneralRe: Main Arguments Pin
Mark Salsbery8-May-07 13:45
Mark Salsbery8-May-07 13:45 
AnswerRe: Main Arguments Pin
ThatsAlok16-May-07 20:26
ThatsAlok16-May-07 20:26 
QuestionC#.net to C++ (simple code conversion) ? Pin
Software_Specialist8-May-07 8:39
Software_Specialist8-May-07 8:39 
AnswerRe: C#.net to C++ (simple code conversion) ? Pin
Hamid_RT8-May-07 9:02
Hamid_RT8-May-07 9:02 
GeneralRe: C#.net to C++ (simple code conversion) ? Pin
Software_Specialist8-May-07 9:09
Software_Specialist8-May-07 9:09 
GeneralRe: C#.net to C++ (simple code conversion) ? Pin
Hamid_RT8-May-07 9:21
Hamid_RT8-May-07 9:21 
AnswerRe: C#.net to C++ (simple code conversion) ? Pin
Mark Salsbery8-May-07 9:22
Mark Salsbery8-May-07 9:22 
Something like this maybe (I've used no MFC and no STL/MFC/ATL string classes)...
bool GetFileName(LPTSTR pszBuffer, DWORD dwBufferSize, LPCTSTR pszFilter)
{
   OPENFILENAME ofn;
   memset(&ofn, 0, sizeof(OPENFILENAME));
   ofn.lStructSize = sizeof(OPENFILENAME);
   ofn.lpstrFilter = pszFilter;
   ofn.lpstrFile = pszBuffer;
   ofn.nMaxFile = dwBufferSize;
   // Remove the following flag for a non-explorer-style dialog
   //  and/or adjust flags for desired functionality (see OPENFILENAME struct in SDK)
   ofn.Flags = OFN_EXPLORER;
   // Add the following flag to hide the "places bar"
   //ofn.FlagsEx = OFN_EX_NOPLACESBAR;
 
   return 0 != ::GetOpenFileName(&ofn);
}
 
...
 
   TCHAR szFileName[MAX_PATH] = _T("");
 
   if (GetFileName(szFileName, MAX_PATH, _T("Bitmaps (*.bmp)\0*.bmp\0Tagged Image File Format(*.tif)\0*.tif\0PNG-24(*.png)\0*.png\0\0")))
   {
      // szFileName contains the pathname to the selected file
      // Do something with it here
   }
   else
   {
      // User cancelled dialog
   }

Mark




"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

GeneralRe: C#.net to C++ (simple code conversion) ? Pin
Software_Specialist8-May-07 10:09
Software_Specialist8-May-07 10:09 
GeneralRe: C#.net to C++ (simple code conversion) ? Pin
Mark Salsbery8-May-07 10:37
Mark Salsbery8-May-07 10:37 
Questioncancel dialog Pin
deeps_cute8-May-07 7:52
deeps_cute8-May-07 7:52 
AnswerRe: cancel dialog Pin
Cedric Moonen8-May-07 7:53
Cedric Moonen8-May-07 7:53 
GeneralRe: cancel dialog Pin
deeps_cute8-May-07 7:58
deeps_cute8-May-07 7:58 
QuestionRe: cancel dialog Pin
David Crow8-May-07 8:11
David Crow8-May-07 8:11 
GeneralRe: cancel dialog Pin
Hamid_RT8-May-07 8:52
Hamid_RT8-May-07 8:52 
AnswerRe: cancel dialog Pin
KellyR8-May-07 10:56
KellyR8-May-07 10:56 
QuestionCDialog with CToolbar Pin
Andy H8-May-07 6:09
Andy H8-May-07 6:09 
AnswerRe: CDialog with CToolbar Pin
Hans Dietrich8-May-07 6:54
mentorHans Dietrich8-May-07 6:54 
GeneralRe: CDialog with CToolbar Pin
Andy H8-May-07 7:37
Andy H8-May-07 7:37 
QuestionRe: CDialog with CToolbar Pin
Mark Salsbery8-May-07 8:32
Mark Salsbery8-May-07 8:32 
AnswerRe: CDialog with CToolbar Pin
KellyR8-May-07 11:01
KellyR8-May-07 11:01 
QuestionTrouble refresh a UI window Dialog / MDI Pin
ScotDolan8-May-07 5:33
ScotDolan8-May-07 5:33 
AnswerRe: Trouble refresh a UI window Dialog / MDI Pin
Hans Dietrich8-May-07 6:15
mentorHans Dietrich8-May-07 6:15 
GeneralRe: Trouble refresh a UI window Dialog / MDI Pin
ScotDolan8-May-07 6:59
ScotDolan8-May-07 6:59 
GeneralRe: Trouble refresh a UI window Dialog / MDI Pin
Hans Dietrich8-May-07 7:10
mentorHans Dietrich8-May-07 7:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.