Click here to Skip to main content
15,884,177 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionWindows message for changing color scheme Pin
_Flaviu5-Oct-15 2:15
_Flaviu5-Oct-15 2:15 
AnswerRe: Windows message for changing color scheme Pin
_Flaviu5-Oct-15 3:07
_Flaviu5-Oct-15 3:07 
QuestionRe: Windows message for changing color scheme Pin
Richard MacCutchan5-Oct-15 3:47
mveRichard MacCutchan5-Oct-15 3:47 
AnswerRe: Windows message for changing color scheme Pin
_Flaviu5-Oct-15 20:18
_Flaviu5-Oct-15 20:18 
AnswerRe: Windows message for changing color scheme Pin
_Flaviu7-Oct-15 0:46
_Flaviu7-Oct-15 0:46 
Questionuploadig adobe reader file in local host in c language Pin
sunycity4-Oct-15 22:31
sunycity4-Oct-15 22:31 
AnswerRe: uploadig adobe reader file in local host in c language Pin
Jochen Arndt4-Oct-15 22:54
professionalJochen Arndt4-Oct-15 22:54 
QuestionCFileDialog OnTypeChange issue Pin
_Flaviu1-Oct-15 20:59
_Flaviu1-Oct-15 20:59 
I derived a class from CFileDialog, named CFileDialogExt. Here, I have the following filters:
1.bmp
2.gif
3.jpg
4.png
5.tiff

In order to setup the right extension for file name, I override OnTypeChange, just like this:
C++
void CFileDialogExt::OnTypeChange()
{
	// TODO: Add your specialized code here and/or call the base class

	switch(GetOFN().nFilterIndex)
	{
	case 1:
		SetDefExt(_T("bmp"));
		break;
	case 2:
		SetDefExt(_T("gif"));
		break;
	case 3:
		SetDefExt(_T("jpg"));
		break;
	case 4:
		SetDefExt(_T("png"));
		break;
	case 5:
		SetDefExt(_T("tiff"));
		break;
	}

	CFileDialog::OnTypeChange();
}


Default type is bmp.

So, I type "aaa" as file name.
Then, I change the type (from combo type), as gif. The file name is still "aaa".
Then, I change again as jpg, the file name is changed as "aaa.gif" !! Is delayed by one changing ... strange ... why ?
Furthermore, I change extension as tiff, the file name is "aaa.jpg", not "aaa.tiff" .... I have done something wrong here ?
QuestionRe: CFileDialog OnTypeChange issue Pin
_Flaviu2-Oct-15 3:00
_Flaviu2-Oct-15 3:00 
AnswerRe: CFileDialog OnTypeChange issue Pin
Maximilien2-Oct-15 4:06
Maximilien2-Oct-15 4:06 
GeneralRe: CFileDialog OnTypeChange issue Pin
_Flaviu4-Oct-15 21:29
_Flaviu4-Oct-15 21:29 
QuestionA c program to project expected number of rabbits on a farm Pin
Arnold Mukisa29-Sep-15 8:27
Arnold Mukisa29-Sep-15 8:27 
AnswerRe: A c program to project expected number of rabbits on a farm Pin
Arnold Mukisa29-Sep-15 8:30
Arnold Mukisa29-Sep-15 8:30 
SuggestionRe: A c program to project expected number of rabbits on a farm Pin
David Crow29-Sep-15 15:42
David Crow29-Sep-15 15:42 
GeneralRe: A c program to project expected number of rabbits on a farm Pin
David Crow29-Sep-15 15:34
David Crow29-Sep-15 15:34 
QuestionRe: A c program to project expected number of rabbits on a farm Pin
Paul Conrad1-Oct-15 7:33
professionalPaul Conrad1-Oct-15 7:33 
GeneralRe: A c program to project expected number of rabbits on a farm Pin
David Crow1-Oct-15 10:19
David Crow1-Oct-15 10:19 
Question0 bytes CImage saved Pin
_Flaviu28-Sep-15 23:47
_Flaviu28-Sep-15 23:47 
QuestionRe: 0 bytes CImage saved Pin
CPallini29-Sep-15 0:02
mveCPallini29-Sep-15 0:02 
AnswerRe: 0 bytes CImage saved Pin
_Flaviu29-Sep-15 0:06
_Flaviu29-Sep-15 0:06 
AnswerRe: 0 bytes CImage saved Pin
_Flaviu29-Sep-15 0:33
_Flaviu29-Sep-15 0:33 
SuggestionRe: 0 bytes CImage saved Pin
Jochen Arndt29-Sep-15 0:36
professionalJochen Arndt29-Sep-15 0:36 
GeneralRe: 0 bytes CImage saved Pin
_Flaviu29-Sep-15 0:57
_Flaviu29-Sep-15 0:57 
GeneralRe: 0 bytes CImage saved Pin
Jochen Arndt29-Sep-15 0:59
professionalJochen Arndt29-Sep-15 0:59 
GeneralRe: 0 bytes CImage saved Pin
_Flaviu29-Sep-15 1:00
_Flaviu29-Sep-15 1:00 

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.