Click here to Skip to main content
15,910,411 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Newbie question about code organization Pin
Michael P Butler6-Aug-03 23:48
Michael P Butler6-Aug-03 23:48 
GeneralRe: Newbie question about code organization Pin
Dangleberry7-Aug-03 0:02
sussDangleberry7-Aug-03 0:02 
GeneralDownloading A whole Website Pin
Anonymous6-Aug-03 18:51
Anonymous6-Aug-03 18:51 
GeneralRe: Downloading A whole Website Pin
Vitali Halershtein6-Aug-03 22:10
Vitali Halershtein6-Aug-03 22:10 
QuestionIs there Noone who can sort it out??? Pin
xxhimanshu6-Aug-03 18:50
xxhimanshu6-Aug-03 18:50 
AnswerRe: Is there Noone who can sort it out??? Pin
Anthony_Yio8-Aug-03 0:10
Anthony_Yio8-Aug-03 0:10 
GeneralIE New window!!! Pin
xxhimanshu6-Aug-03 18:49
xxhimanshu6-Aug-03 18:49 
Generalcasting - simple question Pin
devvvy6-Aug-03 18:44
devvvy6-Aug-03 18:44 
I have this simple question about casting... take a look at the code snippet below:

Base * pBase;
Derived * pDerived;

pBase=new Base(1);

//DOWNCAST:
pDerived = dynamic_cast<derived*> (pBase); //Why did it NOT failed? Sure dynamic_cast supports "down-cast" but pBase is pointing to a "IN-complete" object.
//pDerived = (Derived*) pBase; //What's the difference between this sort of simple casting and dynamic_cast? I know that with simple casting, you can't down-cast. Does it mean that with up-cast, simple casting is just as good as dynamic_cast? I have a feeling that dynamic_cast will check at runtime if the object is complete/incomplete (simple casting don't do this) - and is thus safe. Is this the reason why we use dynamic_cast?

pDerived->m_nAge = 10; //Of course, this will crash.


Also, here's C4303 from MSDN:
"C-style cast from 'type1' to 'type2' is deprecated, use static_cast, __try_cast or dynamic_cast... C-style type casting or function-style casting is NOT SUPPORTED when using Managed Extensions for C++...."
>> I don't think it's NOT SUPPORTED - why the documentation states that it's not supported? I just did it in a C++ managed console application and it's just a warning - not error.


Thanks.

norm
GeneralRe: casting - simple question Pin
Nish Nishant6-Aug-03 21:43
sitebuilderNish Nishant6-Aug-03 21:43 
GeneralRe: casting - simple question Pin
Alexandru Savescu6-Aug-03 23:30
Alexandru Savescu6-Aug-03 23:30 
GeneralRe: casting - simple question Pin
Ryan Binns6-Aug-03 23:49
Ryan Binns6-Aug-03 23:49 
GeneralRe: casting - simple question Pin
devvvy7-Aug-03 1:14
devvvy7-Aug-03 1:14 
Generalhelp about Artificial Intelligence and Graphics Pin
Pham Quang Hai6-Aug-03 18:18
Pham Quang Hai6-Aug-03 18:18 
Generalhelp about Artificial Intelligence and Graphics Pin
Pham Quang Hai6-Aug-03 18:13
Pham Quang Hai6-Aug-03 18:13 
GeneralHelp with program Pin
DaveE9th6-Aug-03 16:18
DaveE9th6-Aug-03 16:18 
GeneralRe: Help with program Pin
Maximilien6-Aug-03 16:31
Maximilien6-Aug-03 16:31 
GeneralRe: Help with program Pin
Terry O'Nolley6-Aug-03 16:50
Terry O'Nolley6-Aug-03 16:50 
GeneralRe: Help with program Pin
bugtesting6-Aug-03 17:25
bugtesting6-Aug-03 17:25 
GeneralRe: Help with program Pin
jhwurmbach6-Aug-03 21:50
jhwurmbach6-Aug-03 21:50 
GeneralRe: Help with program Pin
DaveE9th7-Aug-03 0:52
DaveE9th7-Aug-03 0:52 
GeneralPop-up windows Pin
Hktam6-Aug-03 15:40
Hktam6-Aug-03 15:40 
GeneralRe: Pop-up windows Pin
PJ Arends6-Aug-03 21:48
professionalPJ Arends6-Aug-03 21:48 
GeneralRe: Pop-up windows Pin
Hktam6-Aug-03 21:53
Hktam6-Aug-03 21:53 
GeneralChecking the screen res Pin
bneacetp6-Aug-03 15:29
bneacetp6-Aug-03 15:29 
GeneralRe: Checking the screen res Pin
Hktam6-Aug-03 15:51
Hktam6-Aug-03 15:51 

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.