Click here to Skip to main content
15,889,595 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Small Help. Pin
Antti Keskinen7-Jan-04 1:44
Antti Keskinen7-Jan-04 1:44 
GeneralRe: Small Help. Pin
shultas7-Jan-04 2:56
shultas7-Jan-04 2:56 
GeneralRe: Small Help. Pin
Prakash Nadar7-Jan-04 6:55
Prakash Nadar7-Jan-04 6:55 
GeneralRe: Small Help. Pin
shultas7-Jan-04 11:16
shultas7-Jan-04 11:16 
GeneralSetActiveView Pin
skylonely6-Jan-04 20:29
skylonely6-Jan-04 20:29 
GeneralRe: SetActiveView Pin
morefalt6-Jan-04 23:32
morefalt6-Jan-04 23:32 
GeneralCFileDialog - Open Dialog Pin
murali_utr6-Jan-04 20:21
murali_utr6-Jan-04 20:21 
GeneralRe: CFileDialog - Open Dialog Pin
BaldwinMartin6-Jan-04 21:08
BaldwinMartin6-Jan-04 21:08 
Hi Alway use CommDlgExtendedError to figure out what is wrong with common dialogs.

Next Use
static char BASED_CODE szFilter[] = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*||";

static char BASED_CODE szFilter[] = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*||";
CFileDialog fileDialog(true, NULL, NULL,
(OFN_ALLOWMULTISELECT | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_LONGNAMES | OFN_PATHMUSTEXIST),
szFilter);

fileDialog.m_ofn.lpstrTitle = _T("Choose Files");
//fileDialog.m_ofn.lpTemplateName = "Open";

// need larger filename buffer to support multiselect
TCHAR filenameBuffer[4096] = { 0 } ;
fileDialog.m_ofn.lpstrFile = filenameBuffer;
fileDialog.m_ofn.nMaxFile = sizeof(filenameBuffer) / sizeof(filenameBuffer[0]);

if (IDOK == fileDialog.DoModal())
{
POSITION pos = fileDialog.GetStartPosition();
while (pos != NULL)
{
CString filename = fileDialog.GetNextPathName(pos);
AfxMessageBox(filename);
}
AfxMessageBox("Set Modified Flag");

}
else
{
DWORD errCode = CommDlgExtendedError();
switch (errCode)
{
case 0:
TRACE(_T("User cancelled Extract dialog\n"));
break;
// case FNERR_BUFFERTOOSMALL: // define if needed like #define FNERR_BUFFERTOOSMALL 0x000100
// ::AfxMessageBox(_T("Too many files selected. Try again with fewer files."));
// break;
default:
::AfxMessageBox(_T("An error occurred"));
break;
}
}



Best Wishes and Happy Holiday's,
ez_way
GeneralRe: CFileDialog - Open Dialog Pin
shultas7-Jan-04 2:14
shultas7-Jan-04 2:14 
GeneralThanks Pin
murali_utr7-Jan-04 16:04
murali_utr7-Jan-04 16:04 
GeneralCompiling problem.. Pin
KellyR6-Jan-04 17:55
KellyR6-Jan-04 17:55 
GeneralRe: Compiling problem.. Pin
KellyR6-Jan-04 18:01
KellyR6-Jan-04 18:01 
GeneralCListCtrl and Printing Pin
Sitaram Sukumar6-Jan-04 17:37
Sitaram Sukumar6-Jan-04 17:37 
GeneralRe: CListCtrl and Printing Pin
sunil samineni6-Jan-04 18:53
sunil samineni6-Jan-04 18:53 
GeneralRe: CListCtrl and Printing Pin
Selvam R6-Jan-04 19:13
professionalSelvam R6-Jan-04 19:13 
Generala question about createprocess Pin
cchere6-Jan-04 17:36
cchere6-Jan-04 17:36 
GeneralRe: a question about createprocess Pin
Selvam R6-Jan-04 19:19
professionalSelvam R6-Jan-04 19:19 
GeneralRe: a question about createprocess Pin
Anonymous7-Jan-04 6:19
Anonymous7-Jan-04 6:19 
GeneralRe: a question about createprocess Pin
David Crow7-Jan-04 6:44
David Crow7-Jan-04 6:44 
GeneralRe: a question about createprocess Pin
cchere7-Jan-04 9:41
cchere7-Jan-04 9:41 
GeneralRe: a question about createprocess Pin
David Crow7-Jan-04 9:45
David Crow7-Jan-04 9:45 
GeneralRe: a question about createprocess Pin
cchere7-Jan-04 10:36
cchere7-Jan-04 10:36 
GeneralRe: a question about createprocess Pin
David Crow7-Jan-04 2:54
David Crow7-Jan-04 2:54 
GeneralRe: a question about createprocess Pin
Anonymous7-Jan-04 6:10
Anonymous7-Jan-04 6:10 
GeneralPrinting Bitmaps Pin
GESY6-Jan-04 15:44
GESY6-Jan-04 15:44 

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.