Click here to Skip to main content
15,913,836 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: OnIdle() not getting focus Pin
Mark Salsbery20-Jul-07 5:05
Mark Salsbery20-Jul-07 5:05 
GeneralRe: OnIdle() not getting focus Pin
rp_suman22-Jul-07 19:09
rp_suman22-Jul-07 19:09 
GeneralRe: OnIdle() not getting focus Pin
Mark Salsbery23-Jul-07 5:08
Mark Salsbery23-Jul-07 5:08 
GeneralRe: OnIdle() not getting focus Pin
rp_suman26-Jul-07 18:44
rp_suman26-Jul-07 18:44 
GeneralRe: OnIdle() not getting focus Pin
rp_suman19-Jul-07 22:46
rp_suman19-Jul-07 22:46 
GeneralRe: OnIdle() not getting focus Pin
Mark Salsbery20-Jul-07 5:08
Mark Salsbery20-Jul-07 5:08 
GeneralRe: OnIdle() not getting focus Pin
rp_suman22-Jul-07 18:48
rp_suman22-Jul-07 18:48 
QuestionChecking a valid pointer Pin
Electronic7518-Jul-07 21:37
Electronic7518-Jul-07 21:37 
Hello, I have a vector(CMyData) of an MFC class CMyData in CMyDocumentClass. Because program have to display different sets of Data I usually pass a pointer from a member of this data vector that should be displayed to different view classes. In CMyDataListView, CMyDataPlotView classes before doing anything I first check the validity of pointer with
<br />
if(!AfxIsValidAddress(m_pData, sizeof(CMyData), TRUE))<br />
   return;<br />

this line usually is passed without problem indication I can read and write to memory location pointed by m_pData.
but Next line fails!
<br />
if(!m_pData->IsKindOf(RUNTIME_CLASS(CMyData)))<br />
  return;<br />

It says Access violation writing location 0x000000000
checking Call Stack shows that AfxIsValidAddress(...) has been actually executed without problem.

Can someone explain what is going on please? How should I check that a memory access failure won't happen.
By the way I have to add that in CMyData I have multiple vectors but please note that all this problems occure before I try to access such variables. Actually in the process of checking validity of pointer.

ThanksSmile | :)
AnswerRe: Checking a valid pointer Pin
James R. Twine19-Jul-07 1:01
James R. Twine19-Jul-07 1:01 
QuestionRe: Checking a valid pointer Pin
David Crow19-Jul-07 2:53
David Crow19-Jul-07 2:53 
AnswerRe: Checking a valid pointer Pin
Mike Dimmick19-Jul-07 3:04
Mike Dimmick19-Jul-07 3:04 
AnswerRe: Checking a valid pointer Pin
DevMentor.org19-Jul-07 11:22
DevMentor.org19-Jul-07 11:22 
QuestionUsing ADODC.. Pin
indray2j18-Jul-07 21:32
indray2j18-Jul-07 21:32 
AnswerRe: Using ADODC.. Pin
Karismatic19-Jul-07 0:42
Karismatic19-Jul-07 0:42 
Questionhelp me in removing these warnings Pin
neha.agarwal2718-Jul-07 21:31
neha.agarwal2718-Jul-07 21:31 
AnswerRe: help me in removing these warnings Pin
CPallini18-Jul-07 21:51
mveCPallini18-Jul-07 21:51 
GeneralRe: help me in removing these warnings Pin
rp_suman18-Jul-07 21:59
rp_suman18-Jul-07 21:59 
GeneralRe: help me in removing these warnings Pin
CPallini18-Jul-07 22:10
mveCPallini18-Jul-07 22:10 
GeneralRe: help me in removing these warnings Pin
neha.agarwal2718-Jul-07 22:28
neha.agarwal2718-Jul-07 22:28 
GeneralRe: help me in removing these warnings Pin
CPallini18-Jul-07 22:38
mveCPallini18-Jul-07 22:38 
GeneralRe: help me in removing these warnings Pin
neha.agarwal2718-Jul-07 23:07
neha.agarwal2718-Jul-07 23:07 
GeneralRe: help me in removing these warnings Pin
CPallini18-Jul-07 23:22
mveCPallini18-Jul-07 23:22 
GeneralRe: help me in removing these warnings Pin
neha.agarwal2719-Jul-07 0:34
neha.agarwal2719-Jul-07 0:34 
GeneralRe: help me in removing these warnings Pin
rp_suman18-Jul-07 22:51
rp_suman18-Jul-07 22:51 
GeneralRe: help me in removing these warnings Pin
CPallini18-Jul-07 22:55
mveCPallini18-Jul-07 22:55 

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.