Click here to Skip to main content
15,917,062 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: sprintf like function in memory funtions Pin
Programm3r3-Aug-08 23:35
Programm3r3-Aug-08 23:35 
QuestionVirtual List for CTreeCtrl? Pin
bosfan3-Aug-08 21:52
bosfan3-Aug-08 21:52 
AnswerRe: Virtual List for CTreeCtrl? Pin
Naveen3-Aug-08 22:16
Naveen3-Aug-08 22:16 
GeneralRe: Virtual List for CTreeCtrl? Pin
bosfan3-Aug-08 22:21
bosfan3-Aug-08 22:21 
QuestionPlease help !!! Pin
C++myLife3-Aug-08 20:59
C++myLife3-Aug-08 20:59 
AnswerRe: Please help !!! Pin
ThatsAlok3-Aug-08 21:28
ThatsAlok3-Aug-08 21:28 
AnswerRe: Please help !!! Pin
Varghese Paul M3-Aug-08 21:52
Varghese Paul M3-Aug-08 21:52 
GeneralRe: Please help !!! [modified] Pin
C++myLife4-Aug-08 18:51
C++myLife4-Aug-08 18:51 
GeneralRe: Please help !!! Pin
Varghese Paul M5-Aug-08 6:16
Varghese Paul M5-Aug-08 6:16 
QuestionString table with Russian strings? Pin
ritz12343-Aug-08 20:25
ritz12343-Aug-08 20:25 
Questionback ground color of Message Box Pin
ani_ikram3-Aug-08 20:25
ani_ikram3-Aug-08 20:25 
AnswerRe: back ground color of Message Box Pin
Varghese Paul M3-Aug-08 20:48
Varghese Paul M3-Aug-08 20:48 
AnswerRe: back ground color of Message Box Pin
ThatsAlok3-Aug-08 21:30
ThatsAlok3-Aug-08 21:30 
GeneralRe: back ground color of Message Box Pin
Y_Kaushik3-Aug-08 21:39
Y_Kaushik3-Aug-08 21:39 
GeneralRe: back ground color of Message Box Pin
ThatsAlok3-Aug-08 22:34
ThatsAlok3-Aug-08 22:34 
GeneralRe: back ground color of Message Box Pin
ThatsAlok3-Aug-08 22:34
ThatsAlok3-Aug-08 22:34 
GeneralRe: back ground color of Message Box Pin
Y_Kaushik3-Aug-08 23:24
Y_Kaushik3-Aug-08 23:24 
GeneralRe: back ground color of Message Box Pin
ThatsAlok3-Aug-08 23:35
ThatsAlok3-Aug-08 23:35 
AnswerRe: back ground color of Message Box Pin
bolivar1234-Aug-08 4:49
bolivar1234-Aug-08 4:49 
QuestionInlining Question Pin
Leslie Sanford3-Aug-08 19:36
Leslie Sanford3-Aug-08 19:36 
AnswerRe: Inlining Question Pin
vikas amin4-Aug-08 7:46
vikas amin4-Aug-08 7:46 
AnswerRe: Inlining Question Pin
not_in_use5-Aug-08 11:58
not_in_use5-Aug-08 11:58 
As far as I understand it they won't be inlined, just like regular constants. I have pretty much the same problem right now, except that I don't need to switch types. In this thread I posted my current idea for a workaround (using operator overloading and inline functions), maybe that could help you. It's a hack, but in theory it should work.

As for your templating idea, if you don't need both float and double versions at the same time, you could just use typedefs like so:

// .h file
typedef double myFpType; // Changing this to float changes the type of all constants

const myFpType pi;
...

// .cpp file
const myFpType pi = myFpType( 3.14159265358979 );
...


or using my workaround idea from the link above:
typedef double myFpType;

// In .h file
INLINE_CONST( myFpType, pi, myFpType( 3.14159265358979 ) );


But maybe someone knows a better solution that could help us both out.

Hope that helps,
Peter
QuestionError: Message too long Pin
vikramaditya2343-Aug-08 19:32
vikramaditya2343-Aug-08 19:32 
QuestionRe: Error: Message too long Pin
David Crow4-Aug-08 3:11
David Crow4-Aug-08 3:11 
QuestionStrange problem about IOCP Pin
zengkun1003-Aug-08 16:43
zengkun1003-Aug-08 16:43 

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.