Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

the memory could be "read" ( error in vc++ project)

Status
Not open for further replies.

eboxbd

Programmer
Dec 22, 2002
10
0
0
HK
This project have no syntex error or link error. But, the following error message is occoured when it is executed:

The instruciton at "0X5f43351b" referenced memory at "0X00000000". The memory could no be "read".

Click on OK to terminate the program
Click on CANCEL to debug the program

Please help me.

With best regards,
Lara
 
Put a breakpoint in main

1) Does it get past main
2) If it does, where does it fall over?
3) If it doesn't, do you have any static instantiations? Check those.

If it is a windows program, put a breakpoint in winmain. Are there any DLLs? You may have to put breakpoints in the different DLL mains to find out more.
 
"0X5f43351b" referenced memory at "0X00000000".

You tried to use a NULL pointer or memory address zero. This is why your code compiled OK because, as far as the compiler is concerned, something like this is valid syntax:[tt]

CMyDialog* dlg = NULL;
// ooops - forgot to allocate memory using 'new'
dlg->DoModal();[/tt]

When to comes to execution time, this code tries to DoModal() on a pointer that has address zero (NULL).

You need to check through your intializations and look for things you've assigned NULL and then forgotten to dynamically allocate memory for before using them.

[rockband]
tellis.gif

[sup]programmer (prog'ram'er), n A hot-headed, anorak wearing, pimple-faced computer geek.[/sup]​
 
Hello qednick and xwb,

Thank u very much for your response.
This problem has been solved.

[thumbsup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top