Click here to Skip to main content
16,014,662 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: create a project? Pin
Paul M Watt3-Feb-02 17:41
mentorPaul M Watt3-Feb-02 17:41 
GeneralRe: create a project? Pin
3-Feb-02 17:43
suss3-Feb-02 17:43 
GeneralPointers Pin
Matt Newman3-Feb-02 15:47
Matt Newman3-Feb-02 15:47 
GeneralRe: Pointers Pin
Paul M Watt3-Feb-02 16:06
mentorPaul M Watt3-Feb-02 16:06 
GeneralRe: Pointers Pin
Matt Newman4-Feb-02 11:07
Matt Newman4-Feb-02 11:07 
GeneralRe: Pointers Pin
Matt Newman4-Feb-02 11:35
Matt Newman4-Feb-02 11:35 
GeneralRe: Pointers Pin
Jay Beckert3-Feb-02 16:13
Jay Beckert3-Feb-02 16:13 
GeneralRe: Pointers Pin
Paul M Watt3-Feb-02 16:15
mentorPaul M Watt3-Feb-02 16:15 
For everyones information:

Jay Beckert wrote:
CNetServerDlg* pNetServer = (CNetServerDlg*)AfxGetMainWn();
pNetServer->PrintLog(strLogOutput);


is the same as:

CNetServerDlg* pNetServer = reinterpret_cast<cnetserverdlg*>(AfxGetMainWn());
pNetServer->PrintLog(strLogOutput);

reinterpret_cast simply says to the compiler "I know what I am doing, just go ahead and trust me."
Basically what you are doing is telling the compiler to use convert one data types binary format into another format that is completely different and may not even be compatible.

static_cast is safer because you are saying to the compiler, "I would like to conver this pointer to a compatible type." If that compatible type does not exist, then you will get a compiler error.
GeneralRe: Pointers Pin
Jay Beckert3-Feb-02 16:26
Jay Beckert3-Feb-02 16:26 
GeneralRe: Pointers Pin
Matt Newman3-Feb-02 16:27
Matt Newman3-Feb-02 16:27 
GeneralRe: Pointers Pin
Matt Newman4-Feb-02 11:36
Matt Newman4-Feb-02 11:36 
GeneralRe: Pointers Pin
Jay Beckert5-Feb-02 11:21
Jay Beckert5-Feb-02 11:21 
GeneralRe: Pointers Pin
Matt Newman5-Feb-02 12:43
Matt Newman5-Feb-02 12:43 
GeneralRe: Pointers Pin
Jay Beckert5-Feb-02 13:16
Jay Beckert5-Feb-02 13:16 
General3d rotation Pin
Sergei3-Feb-02 14:49
Sergei3-Feb-02 14:49 
GeneralRe: 3d rotation Pin
Paul M Watt3-Feb-02 15:36
mentorPaul M Watt3-Feb-02 15:36 
Generalread a txt file Pin
magpierre3-Feb-02 12:03
magpierre3-Feb-02 12:03 
GeneralRe: read a txt file Pin
alex.barylski3-Feb-02 13:35
alex.barylski3-Feb-02 13:35 
GeneralRe: read a txt file Pin
Fredrik Skog4-Feb-02 0:07
Fredrik Skog4-Feb-02 0:07 
GeneralC2447 Pin
3-Feb-02 11:59
suss3-Feb-02 11:59 
GeneralRe: C2447 Pin
Derek Waters3-Feb-02 13:41
Derek Waters3-Feb-02 13:41 
GeneralRe: C2447 Pin
alex.barylski3-Feb-02 13:54
alex.barylski3-Feb-02 13:54 
QuestionHow to get the ClientRect?? Pin
Jay Beckert3-Feb-02 10:05
Jay Beckert3-Feb-02 10:05 
AnswerRe: How to get the ClientRect?? Pin
Anders Molin3-Feb-02 10:11
professionalAnders Molin3-Feb-02 10:11 
GeneralRe: How to get the ClientRect?? Pin
Jay Beckert3-Feb-02 14:16
Jay Beckert3-Feb-02 14:16 

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.