Click here to Skip to main content
15,901,205 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
QuestionBackup & Recovery Utility for MS Exchange Pin
Vinay Jain7-Dec-06 2:12
Vinay Jain7-Dec-06 2:12 
Questionhighlight list control items using mouse Pin
YaronNir7-Dec-06 2:06
YaronNir7-Dec-06 2:06 
AnswerRe: highlight list control items using mouse Pin
Sunil P V7-Dec-06 2:28
Sunil P V7-Dec-06 2:28 
Questionload image Pin
Sunil P V7-Dec-06 1:34
Sunil P V7-Dec-06 1:34 
AnswerRe: load image Pin
Hamid_RT7-Dec-06 17:50
Hamid_RT7-Dec-06 17:50 
GeneralRe: load image Pin
Sunil P V7-Dec-06 19:02
Sunil P V7-Dec-06 19:02 
GeneralRe: load image Pin
ThatsAlok7-Dec-06 19:23
ThatsAlok7-Dec-06 19:23 
GeneralRe: load image Pin
Hamid_RT8-Dec-06 1:15
Hamid_RT8-Dec-06 1:15 
QuestionScrolling in a SDI project containing ATL COM Servers Pin
Cyber Friend7-Dec-06 0:58
Cyber Friend7-Dec-06 0:58 
QuestionVC++/MFC Pin
amitmistry_petlad 7-Dec-06 0:18
amitmistry_petlad 7-Dec-06 0:18 
AnswerRe: VC++/MFC Pin
Sunil P V7-Dec-06 1:36
Sunil P V7-Dec-06 1:36 

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.