Solved

Instruction at "0x00000001" referenced memory at "0x00000001". The memory could not be "read".

Posted on 2001-07-09
16
2,868 Views
Last Modified: 2008-03-03
This is the error that I get when I try to compile my project.

Instruction at "0x00000001" referenced memory at "0x00000001". The memory could not be "read".

Then when I hit OK, it gives the following additional messagebox.

The instruction at "0x76338dc9" referenced memory at "0x0000009c". The memory could not be "written".

The title of both messages boxes is:
VB6.EXE  - Application Error.

I copied the entire directory to a different location and get the same message.

When I copied the files, I noticed many .OBJ files with the description "Intermediate File" - I imagine that this is what VB was using to build the exe when I tried to compile it.

Points are not an issue - I need help!!
0
Comment
Question by:wileecoy
  • 6
  • 3
  • 2
  • +4
16 Comments
 
LVL 2

Expert Comment

by:santhoshx
ID: 6267786
Is this problem occurs when you compile the project to exe Are you able to run the application with the option "Start with Full compile" from Run menu.

If VB6 throws exception while building to exe , it is problem with your VB installation. Try reinstalling VB
0
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6268532
Check your RAM also. To check for, you could try compiling your project in another VB installed system.

yes, OBJ files are created by VB when compiling takes place.

Cheers
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 6268926
Do you have plenty of free space on your TEMP drive?

Is there any files with the ReadOnly attributes set?
0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6269128
Try setting your project options to compile using p-code rather than N-code and see if it works or not.

Another method would be to close any VB applications including VB6., go to your temp drive and delete all the VB****.TMp files even if their attributes are read-only (which is usually the case).  Then, run VB and compile the whole thingy.  (This may not help anything at all.)

Could it also be that your vbp file was corrupted somehow?  Create a new vbp (project) file and include all the *.frm and *.bas (and whatever that you've used) files and try running the whole thing again.

The last resort would be to renstall VB6.

That's it!

glass cookie : )
0
 
LVL 3

Expert Comment

by:jrspano
ID: 6269249
i got that a lot on a w2k machine.  I tried everything I could think of to fix it including reinstalling vb. nothing worked.  I finally redid the cpu and it fixed it.  now I am on a different cpu.  I haven't had any of the compile errors, but ever once and a while i get the error when closing a project.
0
 
LVL 4

Author Comment

by:wileecoy
ID: 6269286
I am using w2k.

After posting this message, I created a new project and added all the forms from the old project.  That didn't work.

I will try the other suggestions and see if I get anywhere.

Thanks for the help!
0
 
LVL 4

Author Comment

by:wileecoy
ID: 6269368
Ok - I have completed testing:

None of the following worked -

1. I WAS, yes was able to run the app with - "Start with Full compile"
2. Clear Temp Drive (WinNT\Temp on w2k)
3. Enough memory - I have 256 MG, should be enough.
4. Read-Only files - the only ones were safesource - deleted.
5. I was able to compile other projects.
6. I was NOT able to compile to P-code.

I will try to reinstall VB, however, since I am able to complile other projects, this does not seem real promising.

jrspano - were you able to get it to work on w2k, if so - what exactly did you do?

Thanks again for the help.  This is (was) supposed to go on the market soon (... my ulcer is acting up).
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 6269461
Add your forms and modules one after the other compiling between each to find which one gives you problem.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 3

Expert Comment

by:jrspano
ID: 6269485
I redid the whole cpu from scratch. format drives and redo etc.  the project worked fine after that.  That should tell us that your project is ok.  You should be able to compile it on another cpu for the time being if you need the compiled object right now.
0
 
LVL 4

Author Comment

by:wileecoy
ID: 6269731
emoreau,

I did try doing that, however, I have forms that are dependent on modules and I get compile errors as functions and procedures aren't defined.  So, I wasn't able to specifically identify (without commenting out a LOT of code) if there was one form, module or class that was giving me the problems.

Also - One thing that I didn't consider.  I have McAfee Uninstaller.  Every 30 days it asks me if I want to clean up old temp file, cached internet files... etc.  Well - I did that a couple of days ago.  I usually don't (just been to lazy to reset the option to ask me to "no").  Maybe something happened there.  I am going to see if I can restore that.  A long-shot, but I'll try anything.

Also - I was just creating a new spreadsheet in Excel 2000.  I got a memory address error similar to the one I described above.  May not be VB at all, but may be my w2k or bad memory or hard drive or motherboard or ....

I'll keep posting progress.
0
 
LVL 4

Author Comment

by:wileecoy
ID: 6270494
Well - the McAfee Unistaller didn't work.

I was wondering, if I have the address, isn't there some way that I can identify what would be in that address?

I have c++ and spy++ and all that - isn't there some way to log an error of this type so I can try to hone in on the problem?
0
 
LVL 4

Author Comment

by:wileecoy
ID: 6270815
OK -

All is well.  I have found the problem.

fyi - if you are interested.

First - I re-istalled Visual Studio.  I couldn't figure out why my c++ wasn't allowing me to debug like it usually does.  Well - it allowed me to debug after I re-installed it.

So - I debugged VB6.exe - stepped through all of what looks like cryptic code to me.

I compiled the app and it told me what ocx was having the problem.

I removed the ocx from my application - everything is fine.

Spy++ didn't work, by the way.

So - I am going to split the points up evenly amoung all who responded as each comment was useful.

Please look for a question posted as 'For yourname - Instruction at "0x00000001" referenced memory at "0x00000001". The memory could not be "read".'

Thanks to all for the assistance.
0
 
LVL 3

Expert Comment

by:jrspano
ID: 6270844
what ocx was it?
0
 
LVL 4

Author Comment

by:wileecoy
ID: 6270944
rbutton.ocx - it was a custom control that I downloaded from a vb website.

It was unnecessary, and definately not worth the problem.
0
 
LVL 2

Accepted Solution

by:
Lunchy earned 0 total points
ID: 6271135
0
 
LVL 2

Expert Comment

by:Lunchy
ID: 6271141
wileecoy, I also deleted a duplicate Q for jrspano.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now