Click here to Skip to main content
15,918,243 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalxml validator Pin
1-Jul-01 23:55
suss1-Jul-01 23:55 
GeneralRe: xml validator Pin
markkuk2-Jul-01 0:46
markkuk2-Jul-01 0:46 
GeneralTemplate Question Pin
1-Jul-01 23:47
suss1-Jul-01 23:47 
GeneralRe: Template Question Pin
Martin Vladic2-Jul-01 0:26
Martin Vladic2-Jul-01 0:26 
GeneralRe: Template Question Pin
2-Jul-01 0:41
suss2-Jul-01 0:41 
GeneralRe: Template Question Pin
Martin Vladic2-Jul-01 23:30
Martin Vladic2-Jul-01 23:30 
GeneralRe: Template Question Pin
Martin Vladic2-Jul-01 23:44
Martin Vladic2-Jul-01 23:44 
GeneralRe: Template Question Pin
Tomasz Sowinski2-Jul-01 1:12
Tomasz Sowinski2-Jul-01 1:12 
You need to create a GetFormat function template and specializations for different types. VC++ seems to have problems with some forms of specializations. I was able to make the following code work:

// in TType template
CString GetAsString()
{
CString sValue;
sValue.Format( GetFormat(m_tValue), m_tValue );
return sValue;
}

// without this specializations won't compile on VC 6
template < class T >
CString GetFormat(const T& unused)
{
return CString();
}

template < >
CString GetFormat(const float & unused)
{
	return "%.4e";
}

template < >
CString GetFormat(const int & unused)
{
	return "%d";
}



Tomasz Sowinski -- http://www.shooltz.com.pl
GeneralDisplaying Graphical Primitives of RichText Format Pin
1-Jul-01 23:26
suss1-Jul-01 23:26 
GeneralFailure in CRecordSet::IsOpen() Pin
Kristian Thelin1-Jul-01 23:09
Kristian Thelin1-Jul-01 23:09 
GeneralRe: Failure in CRecordSet::IsOpen() Pin
olof neumann1-Jul-01 23:15
olof neumann1-Jul-01 23:15 
Generaloverriding CEDIT Pin
1-Jul-01 21:43
suss1-Jul-01 21:43 
GeneralWM_CLOSE Pin
vijayaramaraju1-Jul-01 21:27
vijayaramaraju1-Jul-01 21:27 
GeneralRe: WM_CLOSE Pin
Gert Boddaert2-Jul-01 4:48
Gert Boddaert2-Jul-01 4:48 
GeneralRe: WM_CLOSE Pin
Hadi Rezaee2-Jul-01 8:29
Hadi Rezaee2-Jul-01 8:29 
GeneralRe: WM_CLOSE Pin
Jack Handy2-Jul-01 9:52
Jack Handy2-Jul-01 9:52 
GeneralRe: WM_CLOSE Pin
Hadi Rezaee2-Jul-01 10:40
Hadi Rezaee2-Jul-01 10:40 
GeneralRe: WM_CLOSE Pin
Gert Boddaert2-Jul-01 21:36
Gert Boddaert2-Jul-01 21:36 
Questionnew & modal ... stupid questions ? Pin
1-Jul-01 17:21
suss1-Jul-01 17:21 
AnswerRe: new & modal ... stupid questions ? Pin
Christian Graus1-Jul-01 18:15
protectorChristian Graus1-Jul-01 18:15 
AnswerRe: new & modal ... stupid questions ? Pin
zhenguri1-Jul-01 19:10
zhenguri1-Jul-01 19:10 
GeneralRe: new & modal ... stupid questions ? Pin
2-Jul-01 10:33
suss2-Jul-01 10:33 
General"No Disk" message. Pin
Gunter Maywald1-Jul-01 17:04
Gunter Maywald1-Jul-01 17:04 
GeneralRe: "No Disk" message. Pin
Andrew Lawrence9-Feb-10 12:10
Andrew Lawrence9-Feb-10 12:10 
GeneralConverting CString to int in Visaul C++, please help. Pin
JavaTony1-Jul-01 16:55
JavaTony1-Jul-01 16:55 

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.