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

C / C++ / MFC

 
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 
AnswerRe: Typecasting incompatible types Pin
Mark Salsbery7-Dec-06 5:57
Mark Salsbery7-Dec-06 5:57 
WillemM wrote:
B derives from A and as such I can cast between them


If this is truly the case then you should have no problem casting between them.
Therefore, you can use the safer dynamic_cast operator to perform the cast.
void* blankhandle = (void*)&ahandle;
Handle<B> *pBHandle = dynamic_cast<Handle<B>*>(blankhandle);
if (pBHandle)
{
	Handle<B> bhandle = *pBHandle;
...
}
Note I checked the return from dynamic_cast. If the object wasn't created as a B type handle
then it would fail as it should.
>
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 
AnswerRe: VC++/MFC Pin
Sam Hobbs7-Dec-06 2:14
Sam Hobbs7-Dec-06 2:14 

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.