Click here to Skip to main content
15,915,324 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Book Recommendation Pin
Sam Hobbs7-Dec-06 3:20
Sam Hobbs7-Dec-06 3:20 
GeneralRe: Book Recommendation Pin
toxcct7-Dec-06 5:01
toxcct7-Dec-06 5:01 
GeneralRe: Book Recommendation Pin
Sam Hobbs7-Dec-06 11:20
Sam Hobbs7-Dec-06 11:20 
GeneralRe: Book Recommendation Pin
ThatsAlok7-Dec-06 18:04
ThatsAlok7-Dec-06 18:04 
GeneralRe: Book Recommendation Pin
Hamid_RT7-Dec-06 18:18
Hamid_RT7-Dec-06 18:18 
GeneralRe: Book Recommendation Pin
ThatsAlok7-Dec-06 18:29
ThatsAlok7-Dec-06 18:29 
GeneralRe: Book Recommendation Pin
Hamid_RT7-Dec-06 18:51
Hamid_RT7-Dec-06 18:51 
AnswerRe: Book Recommendation Pin
Hamid_RT7-Dec-06 17:55
Hamid_RT7-Dec-06 17:55 
Questionloading an image Pin
Sunil P V7-Dec-06 2:29
Sunil P V7-Dec-06 2:29 
AnswerRe: loading an image Pin
Chris Losinger7-Dec-06 8:32
professionalChris Losinger7-Dec-06 8:32 
AnswerRe: loading an image Pin
Hamid_RT7-Dec-06 17:59
Hamid_RT7-Dec-06 17:59 
QuestionCFile does not open Pin
BadJerry7-Dec-06 2:27
BadJerry7-Dec-06 2:27 
AnswerRe: CFile does not open Pin
prasad_som7-Dec-06 2:39
prasad_som7-Dec-06 2:39 
GeneralRe: CFile does not open Pin
BadJerry7-Dec-06 2:45
BadJerry7-Dec-06 2:45 
GeneralRe: CFile does not open Pin
prasad_som7-Dec-06 3:12
prasad_som7-Dec-06 3:12 
GeneralRe: CFile does not open Pin
BadJerry7-Dec-06 4:54
BadJerry7-Dec-06 4:54 
GeneralRe: CFile does not open Pin
prasad_som7-Dec-06 18:22
prasad_som7-Dec-06 18:22 
AnswerRe: CFile does not open Pin
Mark Salsbery7-Dec-06 5:44
Mark Salsbery7-Dec-06 5:44 
QuestionTypecasting incompatible types Pin
WillemM7-Dec-06 2:22
WillemM7-Dec-06 2:22 
I have a question about typecasting incompatible types. I have two handles to objects, the handle class is a template class that functions as a smartpointer implementation.

Handle<A> ahandle(new B);
Handle<B> bhandle;

What I want is to cast from Handle<A> to Handle<B>. B derives from A and as such I can cast between them. The only problem is, I can't cast the handles directly.

I have come up with a solution involving some dirty hacking, but I am unsure if this is going to work and what it will do at runtime.

void* blankhandle = (void*)&ahandle;
Handle<B> bhandle = *(reinterpret_cast<Handle<B> >(blankhandle));

Hope anyone can shed some light on this.

WM.

What about weapons of mass-construction?
"You can always try to smash it with a wrench to fix that. It might actually work" - WillemM

AnswerRe: Typecasting incompatible types Pin
Mark Salsbery7-Dec-06 5:57
Mark Salsbery7-Dec-06 5:57 
GeneralRe: Typecasting incompatible types Pin
WillemM7-Dec-06 6:26
WillemM7-Dec-06 6:26 
GeneralRe: Typecasting incompatible types Pin
Mark Salsbery7-Dec-06 6:43
Mark Salsbery7-Dec-06 6:43 
GeneralRe: Typecasting incompatible types Pin
WillemM7-Dec-06 6:44
WillemM7-Dec-06 6:44 
GeneralRe: Typecasting incompatible types Pin
Mark Salsbery7-Dec-06 6:51
Mark Salsbery7-Dec-06 6:51 
AnswerRe: Typecasting incompatible types [modified] Pin
Stephen Hewitt7-Dec-06 11:52
Stephen Hewitt7-Dec-06 11:52 

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.