access violation reading location 0x00000000
hello..
i am running a thread.but when i try to print anything edit box using the line
aa.Format("%d",i);
ts->_this->GetDlgItem(IDC_EDIT3)->SetWindowText(aa);//run time error occurs here.
my code is compilation error free.but i get an error when i run it as
access violation reading location 0x00000000
plz help.
Re: access violation reading location 0x00000000
You are trying to dereference a pointer that has a value of 0 (null). In the debugger put a breakpoint on that line and examine the contents of the variables. You'll then know which is the one that is 0.
Re: access violation reading location 0x00000000
thanks for the reply..but even though i put a breakpoint on that particular line in debug mode.i am not able check the values of the variables..most of my variables are global variables..plz help.
Re: access violation reading location 0x00000000
What compiler/debugger are you using?
Re: access violation reading location 0x00000000
Quote:
Originally Posted by
Ramdhyani
hello..
i am running a thread.but when i try to print anything edit box using the line
aa.Format("%d",i);
ts->_this->GetDlgItem(IDC_EDIT3)->SetWindowText(aa);//run time error occurs here.
my code is compilation error free.but i get an error when i run it as
access violation reading location 0x00000000
plz help.
1. What is ts?
2. What is _this?
3. Are you trying to access the IDC_EDIT3 control from within a worker thread? It appears to be a wrong design. Please, check out this great Joe Newcomer's essay: Using Worker Threads
Re: access violation reading location 0x00000000
Re: access violation reading location 0x00000000
Then when the break point triggers you should be able to view the contents of the variables - and see which pointer is 0.
See
https://blogs.msdn.microsoft.com/dev...visual-studio/
https://msdn.microsoft.com/en-us/lib...v=vs.100).aspx
Re: access violation reading location 0x00000000
The UI and all its controls should only be modified from the main thread, not from worker threads.