Click here to Skip to main content
16,004,678 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: STL - Newbie... Pin
Bernhard31-Jan-02 23:51
Bernhard31-Jan-02 23:51 
GeneralSorry i was in a hurry... Pin
Bernhard31-Jan-02 23:53
Bernhard31-Jan-02 23:53 
GeneralRe: STL - Newbie... Pin
Joaquín M López Muñoz1-Feb-02 3:15
Joaquín M López Muñoz1-Feb-02 3:15 
Generalimport a .DXF file Pin
Gayan31-Jan-02 20:31
Gayan31-Jan-02 20:31 
GeneralRe: import a .DXF file Pin
Jon Hulatt31-Jan-02 23:00
Jon Hulatt31-Jan-02 23:00 
GeneralRe: import a .DXF file Pin
Roger Allen1-Feb-02 3:30
Roger Allen1-Feb-02 3:30 
GeneralOO Design question Pin
Jerome Conus31-Jan-02 19:48
Jerome Conus31-Jan-02 19:48 
GeneralRe: OO Design question Pin
Paul M Watt31-Jan-02 20:11
mentorPaul M Watt31-Jan-02 20:11 
You could write a conversion operator for the different types. The conversion operator can upgrade certain types to the next level when it is necessary. For example, you would create this function for your CInteger class:

<br />
CInteger::operator CFloat()<br />
{<br />
    // construct a CFloat from this integer class.<br />
    return CFloat(this);<br />
}<br />


This will convert a CInteger object to a CFloat object whenever the compiler sees the opportunity to do this. For example, given this function:

<br />
bool CFloat::Add(CFloat lhs, CFloat rhs);<br />


call the function with these parameters:

<br />
CInteger i;<br />
CFloat   f;<br />
<br />
CFloat answer;<br />
<br />
answer.Add(f, i);<br />
<br />


i, or CInteger would transparently be converted to a CFloat for you. The only hard part to this solution is to determine the proper relationships between all of the objects and what parameter types should be converted or upgraded to the other types.
GeneralRe: OO Design question Pin
Bernhard31-Jan-02 20:14
Bernhard31-Jan-02 20:14 
GeneralRe: OO Design question Pin
Joaquín M López Muñoz31-Jan-02 20:20
Joaquín M López Muñoz31-Jan-02 20:20 
GeneralAbout "https://" Pin
wabc31-Jan-02 19:28
wabc31-Jan-02 19:28 
GeneralRe: About "https://" Pin
Kastellanos Nikos1-Feb-02 2:07
Kastellanos Nikos1-Feb-02 2:07 
GeneralRe: About "https://" Pin
lucy1-Feb-02 3:32
lucy1-Feb-02 3:32 
QuestionHow to make an installation package with VC++6 Pin
DengJW31-Jan-02 18:54
DengJW31-Jan-02 18:54 
AnswerRe: How to make an installation package with VC++6 Pin
Mazdak31-Jan-02 19:03
Mazdak31-Jan-02 19:03 
GeneralRe: How to make an installation package with VC++6 Pin
DengJW31-Jan-02 19:57
DengJW31-Jan-02 19:57 
Questioncan I write a program to record Windows sytem up/off time? Pin
DengJW31-Jan-02 18:51
DengJW31-Jan-02 18:51 
AnswerRe: can I write a program to record Windows sytem up/off time? Pin
wangyiming31-Jan-02 19:18
wangyiming31-Jan-02 19:18 
GeneralRe: can I write a program to record Windows sytem up/off time? Pin
DengJW31-Jan-02 19:34
DengJW31-Jan-02 19:34 
AnswerRe: can I write a program to record Windows sytem up/off time? Pin
wangyiming31-Jan-02 19:30
wangyiming31-Jan-02 19:30 
GeneralRe: can I write a program to record Windows sytem up/off time? Pin
DengJW31-Jan-02 20:20
DengJW31-Jan-02 20:20 
AnswerRe: can I write a program to record Windows sytem up/off time? Pin
wangyiming31-Jan-02 20:16
wangyiming31-Jan-02 20:16 
Generalthen how about shutdown? Pin
DengJW31-Jan-02 20:23
DengJW31-Jan-02 20:23 
AnswerRe: can I write a program to record Windows sytem up/off time? Pin
Jon Sagara31-Jan-02 21:31
Jon Sagara31-Jan-02 21:31 
Generalend of file Pin
31-Jan-02 18:25
suss31-Jan-02 18:25 

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.