Click here to Skip to main content
15,908,264 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Refresh Pin
Bob Stanneveld8-Oct-05 0:15
Bob Stanneveld8-Oct-05 0:15 
QuestionChange Caption Pin
Member 20251767-Oct-05 21:06
Member 20251767-Oct-05 21:06 
AnswerRe: Change Caption Pin
ThatsAlok7-Oct-05 21:29
ThatsAlok7-Oct-05 21:29 
QuestionRebar Pin
karmendra_js7-Oct-05 20:48
karmendra_js7-Oct-05 20:48 
QuestionExplain in brief this error... Pin
Supriya Tonape7-Oct-05 20:10
Supriya Tonape7-Oct-05 20:10 
AnswerRe: Explain in brief this error... Pin
ThatsAlok7-Oct-05 20:36
ThatsAlok7-Oct-05 20:36 
GeneralRe: Explain in brief this error... Pin
Supriya Tonape7-Oct-05 20:46
Supriya Tonape7-Oct-05 20:46 
GeneralRe: Explain in brief this error... Pin
S. Senthil Kumar7-Oct-05 21:15
S. Senthil Kumar7-Oct-05 21:15 
Well, you can't arbitrarily assign an address to a pointer and expect it to work. Did you do something like
void *p = (void *)0x003261b6;
?
Let me try explaining why it doesn't work in the simplest way possible.

Every program has something called a virtual address space allocated to it, to prevent one program from trampling over another program's memory. Now whenever you try to access memory, the OS and the CPU conspire to translate the virtual address to the actual physical address. To do this, the OS has to maintain a mapping between virtual and physical addresses and has to know which virtual addresses have been allocated by the program and which have not.

In your case, you're trying to access an address which has not been allocated to the program and that's why you're getting the access violation error. You must consider yourself lucky it crashed straightaway. Imagine the consequences if it worked on your PC, because by some coincidence that memory *was* allocated somewhere else (by the OS or by you), and it crashed right in front a 100 people when you are giving a demo.

Bottom line : Never do the above unless you are dead sure that address has been allocated.

Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
GeneralRe: Explain in brief this error... Pin
Supriya Tonape7-Oct-05 22:32
Supriya Tonape7-Oct-05 22:32 
GeneralRe: Explain in brief this error... Pin
S. Senthil Kumar8-Oct-05 1:15
S. Senthil Kumar8-Oct-05 1:15 
GeneralRe: Explain in brief this error... Pin
Anonymous11-Oct-05 7:58
Anonymous11-Oct-05 7:58 
QuestionSystem Inactivity Pin
Ivan Cachicatari7-Oct-05 17:52
Ivan Cachicatari7-Oct-05 17:52 
AnswerRe: System Inactivity Pin
ThatsAlok7-Oct-05 19:38
ThatsAlok7-Oct-05 19:38 
GeneralRe: System Inactivity Pin
Ivan Cachicatari8-Oct-05 3:04
Ivan Cachicatari8-Oct-05 3:04 
Questiondb grid control? Pin
cell517-Oct-05 15:19
cell517-Oct-05 15:19 
Questionsimple program help Pin
Anonymous7-Oct-05 14:43
Anonymous7-Oct-05 14:43 
AnswerRe: simple program help Pin
ThatsAlok7-Oct-05 19:53
ThatsAlok7-Oct-05 19:53 
Answer[Message Deleted] Pin
v(A)ssili8-Oct-05 19:14
v(A)ssili8-Oct-05 19:14 
GeneralRe: simple program help Pin
Gary R. Wheeler9-Oct-05 2:59
Gary R. Wheeler9-Oct-05 2:59 
AnswerRe: simple program help Pin
John R. Shaw8-Oct-05 23:46
John R. Shaw8-Oct-05 23:46 
QuestionObject Help Pin
Anonymous7-Oct-05 14:07
Anonymous7-Oct-05 14:07 
AnswerRe: Object Help Pin
Chris Losinger7-Oct-05 17:18
professionalChris Losinger7-Oct-05 17:18 
GeneralRe: Object Help Pin
Anonymous7-Oct-05 19:09
Anonymous7-Oct-05 19:09 
GeneralRe: Object Help Pin
Anonymous7-Oct-05 19:51
Anonymous7-Oct-05 19:51 
GeneralRe: Object Help Pin
Chris Losinger8-Oct-05 3:46
professionalChris Losinger8-Oct-05 3:46 

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.