Error assigning values?!!
-
Downcasts are always unsafe. Are you sure that the
CView*
returned byGetActiveView()
is aCMy3027View*
? If it's not, the program may bomb... -
i don't know how to see that the returned pointer is a CMy3027View*..but i've only one CView-derived class so i thought it should be?
Try to use a
dynamic_cast
. If the returned value isNULL
, then the pointer is not of that class. -
it means the GetActiveView() stopped worked in your program. Check carefully what it does (if you have source control check what it used to do)
-
Try to use a
dynamic_cast
. If the returned value isNULL
, then the pointer is not of that class. -
How do i use dynamic_cast?...sorry,i've heard of it but i've never tried anything like that..
Do this:
pView = dynamic_cast<CMy3027View*>(pMF->GetActiveView());
if(pView)
m_numOfValues= pView->m_imageIndex;You might have to turn on the RTTI option in VC.
-
Do this:
pView = dynamic_cast<CMy3027View*>(pMF->GetActiveView());
if(pView)
m_numOfValues= pView->m_imageIndex;You might have to turn on the RTTI option in VC.
-
It ran into exception handling error while executing pView = dynamic_cast(pMF->GetActiveView()); Anyway...is there a better way to obtain member variables of a CView class then?
-
good grief :mad: the code you posted is horribly wrong considering it was provided to you correctly
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
-
;Poops...i mean i did run the right statement(that below) when i got an exception error. pView = dynamic_cast(pMF->GetActiveView());
-
oh, u missed the "display this message as-is (no HTML)" check box. sorry :-O did you turn on the RTTI build option?
"No matter where you go, there your are..." - Buckaoo Banzi
-pete