Click here to Skip to main content
15,887,214 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to increase the width and height of a bitmap in mfc.? Pin
_Flaviu28-Feb-13 21:00
_Flaviu28-Feb-13 21:00 
GeneralRe: how to increase the width and height of a bitmap in mfc.? Pin
mbatra311-Mar-13 1:13
mbatra311-Mar-13 1:13 
AnswerRe: how to increase the width and height of a bitmap in mfc.? Pin
Jochen Arndt28-Feb-13 21:20
professionalJochen Arndt28-Feb-13 21:20 
QuestionHELP: UNICODE conversion sprung up problems with CString & CHARFORMAT2 Pin
andwan028-Feb-13 4:00
andwan028-Feb-13 4:00 
AnswerRe: HELP: UNICODE conversion sprung up problems with CString & CHARFORMAT2 Pin
Jochen Arndt28-Feb-13 4:52
professionalJochen Arndt28-Feb-13 4:52 
QuestionDialog Template is replacing Standard Dialog Pin
002comp27-Feb-13 23:11
002comp27-Feb-13 23:11 
AnswerRe: Dialog Template is replacing Standard Dialog Pin
Richard MacCutchan28-Feb-13 3:02
mveRichard MacCutchan28-Feb-13 3:02 
GeneralRe: Dialog Template is replacing Standard Dialog Pin
002comp28-Feb-13 19:41
002comp28-Feb-13 19:41 
Here is the Class that i Sublasses from CFileDialog with setting last parameter in CFileDialog bVistaStyle to FALSE.

C++
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 22:01
mveRichard MacCutchan28-Feb-13 22:01 
GeneralRe: Dialog Template is replacing Standard Dialog Pin
002comp1-Mar-13 0:33
002comp1-Mar-13 0:33 
QuestionChange Network configuration using win32 VC++ Pin
Sachin k Rajput 27-Feb-13 22:13
Sachin k Rajput 27-Feb-13 22:13 
SuggestionRe: Change Network configuration using win32 VC++ Pin
Richard MacCutchan28-Feb-13 3:01
mveRichard MacCutchan28-Feb-13 3:01 
QuestionHow to change the size of Property sheet or Property Page in MFC.? Pin
mbatra3127-Feb-13 18:11
mbatra3127-Feb-13 18:11 
AnswerRe: How to change the size of Property sheet or Property Page in MFC.? Pin
David Crow28-Feb-13 4:19
David Crow28-Feb-13 4:19 
QuestionHow to determine in runtime the class type of inhetited class from common base class? Pin
oleg6327-Feb-13 6:48
professionaloleg6327-Feb-13 6:48 
QuestionRe: How to determine in runtime the class type of inhetited class from common base class? Pin
David Crow27-Feb-13 7:09
David Crow27-Feb-13 7:09 
AnswerRe: How to determine in runtime the class type of inhetited class from common base class? Pin
oleg6327-Feb-13 7:12
professionaloleg6327-Feb-13 7:12 
AnswerRe: How to determine in runtime the class type of inhetited class from common base class? Pin
Maximilien27-Feb-13 8:02
Maximilien27-Feb-13 8:02 
QuestionLinker error with CLSID defined in uuids.h Pin
Vaclav_27-Feb-13 5:56
Vaclav_27-Feb-13 5:56 
AnswerRe: Linker error with CLSID defined in uuids.h Pin
Richard MacCutchan27-Feb-13 6:19
mveRichard MacCutchan27-Feb-13 6:19 
GeneralRe: Linker error with CLSID defined in uuids.h Pin
Vaclav_27-Feb-13 6:38
Vaclav_27-Feb-13 6:38 
GeneralRe: Linker error with CLSID defined in uuids.h Pin
Richard MacCutchan27-Feb-13 7:25
mveRichard MacCutchan27-Feb-13 7:25 
GeneralRe: Linker error with CLSID defined in uuids.h Pin
Vaclav_27-Feb-13 7:39
Vaclav_27-Feb-13 7:39 
GeneralRe: Linker error with CLSID defined in uuids.h Pin
Richard MacCutchan27-Feb-13 9:20
mveRichard MacCutchan27-Feb-13 9:20 
AnswerRe: Linker error with CLSID defined in uuids.h Pin
Vaclav_27-Feb-13 15:32
Vaclav_27-Feb-13 15: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.