Solved

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

Posted on 2001-07-09
16
2,900 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 70

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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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 70

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
 
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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

777 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