Click here to Skip to main content
12,621,302 members (29,413 online)

C / C++ / MFC

 
AnswerRe: how to increase the width and height of a bitmap in mfc.? Pin
Flaviu228-Feb-13 22:00
memberFlaviu228-Feb-13 22:00 
GeneralRe: how to increase the width and height of a bitmap in mfc.? Pin
mbatra311-Mar-13 2:13
membermbatra311-Mar-13 2:13 
AnswerRe: how to increase the width and height of a bitmap in mfc.? Pin
Jochen Arndt28-Feb-13 22:20
memberJochen Arndt28-Feb-13 22:20 
QuestionHELP: UNICODE conversion sprung up problems with CString & CHARFORMAT2 Pin
andwan028-Feb-13 5:00
memberandwan028-Feb-13 5:00 
AnswerRe: HELP: UNICODE conversion sprung up problems with CString & CHARFORMAT2 Pin
Jochen Arndt28-Feb-13 5:52
memberJochen Arndt28-Feb-13 5:52 
QuestionDialog Template is replacing Standard Dialog Pin
yogeshs28-Feb-13 0:11
memberyogeshs28-Feb-13 0:11 
AnswerRe: Dialog Template is replacing Standard Dialog Pin
Richard MacCutchan28-Feb-13 4:02
mvpRichard MacCutchan28-Feb-13 4:02 
GeneralRe: Dialog Template is replacing Standard Dialog Pin
yogeshs28-Feb-13 20:41
memberyogeshs28-Feb-13 20:41 
Here is the Class that i Sublasses from CFileDialog with setting last parameter in CFileDialog bVistaStyle to FALSE.

FileDialogTemplate::FileDialogTemplate(const LPCSTR caption, BOOL bOpenFile,
 LPCSTR lpszDefExt, LPCSTR lpszFileName, DWORD dwFlags, LPCSTR lpszFilter,
 CWnd* pParentWnd, int idx, BOOL pain, BOOL sav7, char* DefDir, int typ,
 BOOL ivrit, int ver, int nVersion, BOOL multy, LPFNDLL_SWITCHREAD pSwitchRead)
 : CFileDialog(bOpenFile, bOpenFile ? lpszDefExt : NULL,
    alignFileName(lpszFileName), 
    (typ == sf_spec) ?
	 ((dwFlags != 0) ? dwFlags : OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT) :
	(typ == sf_bmp || typ == sf_fpf) ? 
    (OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | 
	 OFN_NOCHANGEDIR | OFN_ENABLETEMPLATE | OFN_EXPLORER) :
	(typ == sf_dsn_dir) ?
	(OFN_HIDEREADONLY | OFN_NOVALIDATE | OFN_ENABLETEMPLATE | OFN_EXPLORER) :
	(typ == sf_dsn || typ == sf_dsp || typ == sf_rul) ?
    (OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT |
     OFN_ENABLETEMPLATE | OFN_EXPLORER) : 
	(typ == sf_log) ?
    (OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_EXPLORER) :
    (OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_EXPLORER),
    lpszFilter, pParentWnd,0UL,FALSE)
{
	m_pSwitchRead = pSwitchRead;
 
	m_DefExt = (bOpenFile || lpszDefExt == NULL) ? "" : lpszDefExt;  
	m_Multy = multy && bOpenFile; 
	HMODULE hResourceOld = ::AfxGetResourceHandle(); 
	::AfxSetResourceHandle(SHARED_RES_MODULE); 
 
	ivrit_eng = ivrit; 
	m_ver = (typ == sf_dsn_dir || 
	  typ == sf_dsn || typ == sf_dsp || typ == sf_rul) ? ver : 0; 
	rul_num = rul_size_num = 0; 
	bOpenFileDialog = bOpenFile; 
	sv7 = FALSE;
//	 (!bOpenFile && sav7 && (typ == sf_dsn_dir || typ == sf_dsn || typ == sf_dsp || typ == sf_rul);
	paint = (pain &&
	  (typ == sf_dsn_dir || typ == sf_dsn || typ == sf_dsp || typ == sf_bmp ||
	   typ == sf_rul || typ == sf_fpf || typ == sf_spec));
	type = typ;
	save7 = 0; 
	m_pImage = NULL;
	m_Bitmap = NULL;
	m_IsModulateFile = FALSE;
	m_SizeSel = 0;
	m_ofn.hInstance = SHARED_RES_MODULE; 
	title = new char[_MAX_PATH]; 
	title[0] = '\0'; 
	m_ofn.lpstrFileTitle = title; 
	m_ofn.nMaxFileTitle = _MAX_PATH; 
	int buf_size = 65536; 
	file_buf = new char[buf_size]; 
	file_buf[0] = '\0'; 
	file_buf[buf_size-1] = '\0'; 
	if ( lpszFileName != NULL ) 
		lstrcpyn(file_buf, lpszFileName, buf_size-1);
	m_ofn.lpstrFile = file_buf; 
	m_ofn.nMaxFile = buf_size - 1; 
	if ( caption != NULL )	{
		m_ofn.lpstrTitle = caption;
	} else 
		m_ofn.lpstrTitle = title;
	LPCSTR DefExt = lpszDefExt; 
	char un[8];
	if ( idx != 0 && lpszFilter != NULL ) {
		m_ofn.nFilterIndex = (DWORD)idx;
		int ii = idx + idx - 1, in = 0; 
		const char* p = lpszFilter;
		while ( ii > 0 ) {
			if ( *p == '|' )
				ii--;
			p++;
		}
		p += 2;
		while ( *p != '|' && in < 4 )
			un[in++] = *p++;
		un[in] = (char)0;
		DefExt = un;
	}
 
	lstrcpyn(str, ::TGetIniString("ExtPath", DefExt), _MAX_PATH);
	m_ofn.lpstrInitialDir = (DefDir == NULL) ? str : DefDir; 
	m_ofn.lpTemplateName = MAKEINTRESOURCE(
	  (ver == 0) ? IDD_OPENSAVE_TEMPLATE : IDD_OPENSAVE_TEMPLATE_NEW);
	if ( !bOpenFile && typ != sf_dsn_dir ) 
		m_ofn.Flags |= OFN_FILEMUSTEXIST;
	NOVALIDATE_flag = ((m_ofn.Flags & OFN_NOVALIDATE) != 0);
	if ( !NOVALIDATE_flag && typ != sf_dsn_dir ) 
		m_ofn.Flags |= OFN_NOVALIDATE;
	if ( m_Multy ) 
		m_ofn.Flags |= OFN_ALLOWMULTISELECT;
 
	m_view_mode = -1;
 
	::AfxSetResourceHandle(hResourceOld); 
}

Regards
Y
GeneralRe: Dialog Template is replacing Standard Dialog Pin
Richard MacCutchan28-Feb-13 23:01
mvpRichard MacCutchan28-Feb-13 23:01 
GeneralRe: Dialog Template is replacing Standard Dialog Pin
yogeshs1-Mar-13 1:33
memberyogeshs1-Mar-13 1:33 
QuestionChange Network configuration using win32 VC++ Pin
toms from newdelhi27-Feb-13 23:13
membertoms from newdelhi27-Feb-13 23:13 
SuggestionRe: Change Network configuration using win32 VC++ Pin
Richard MacCutchan28-Feb-13 4:01
mvpRichard MacCutchan28-Feb-13 4:01 
QuestionHow to change the size of Property sheet or Property Page in MFC.? Pin
mbatra3127-Feb-13 19:11
membermbatra3127-Feb-13 19:11 
AnswerRe: How to change the size of Property sheet or Property Page in MFC.? Pin
DavidCrow28-Feb-13 5:19
memberDavidCrow28-Feb-13 5:19 
QuestionHow to determine in runtime the class type of inhetited class from common base class? Pin
oleg6327-Feb-13 7:48
memberoleg6327-Feb-13 7:48 
QuestionRe: How to determine in runtime the class type of inhetited class from common base class? Pin
DavidCrow27-Feb-13 8:09
memberDavidCrow27-Feb-13 8:09 
AnswerRe: How to determine in runtime the class type of inhetited class from common base class? Pin
oleg6327-Feb-13 8:12
memberoleg6327-Feb-13 8:12 
AnswerRe: How to determine in runtime the class type of inhetited class from common base class? Pin
Maximilien27-Feb-13 9:02
memberMaximilien27-Feb-13 9:02 
QuestionLinker error with CLSID defined in uuids.h Pin
Vaclav_Sal27-Feb-13 6:56
memberVaclav_Sal27-Feb-13 6:56 
AnswerRe: Linker error with CLSID defined in uuids.h Pin
Richard MacCutchan27-Feb-13 7:19
mvpRichard MacCutchan27-Feb-13 7:19 
GeneralRe: Linker error with CLSID defined in uuids.h Pin
Vaclav_Sal27-Feb-13 7:38
memberVaclav_Sal27-Feb-13 7:38 
GeneralRe: Linker error with CLSID defined in uuids.h Pin
Richard MacCutchan27-Feb-13 8:25
mvpRichard MacCutchan27-Feb-13 8:25 
GeneralRe: Linker error with CLSID defined in uuids.h Pin
Vaclav_Sal27-Feb-13 8:39
memberVaclav_Sal27-Feb-13 8:39 
GeneralRe: Linker error with CLSID defined in uuids.h Pin
Richard MacCutchan27-Feb-13 10:20
mvpRichard MacCutchan27-Feb-13 10:20 
AnswerRe: Linker error with CLSID defined in uuids.h Pin
Vaclav_Sal27-Feb-13 16:32
memberVaclav_Sal27-Feb-13 16:32 

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.


Advertise | Privacy | Mobile
Web01 | 2.8.161128.1 | Last Updated 2 Dec 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid