473,385 Members | 1,344 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

strange runtime error - I need help debuginng

My program behaves very strange. I keep getting the following error:
'The instruction at "some address" referenced memory at "some address". The
memory could not be written"'
The program consists of:
int main( int argc, char* argv[] )
{
//here is some third party function that configures graphic environment
{
app my_app; //this is local so that I'm sure it's destroyed before
next step
}
//here is some third party function that cleans graphic environment
return 0;
}
But when, instead of my_app object, I put there all of its data members (app
class has no constructor or destructor), it gives me no error!! I don't know
what to do. I don't know how to debug in Visual Studio and I don't know how
wheteher it would help me understand what's going on since my program relies
on some third party dll.
Dec 18 '06 #1
4 1428
I commented out the third party functions and now I'm sure this error is
caused by this local object. But when I put there its data members instead
it gives me no error!!
Dec 18 '06 #2

r.z. wrote:
My program behaves very strange. I keep getting the following error:
'The instruction at "some address" referenced memory at "some address". The
memory could not be written"'
The program consists of:
int main( int argc, char* argv[] )
{
//here is some third party function that configures graphic environment
{
app my_app; //this is local so that I'm sure it's destroyed before
next step
}
//here is some third party function that cleans graphic environment
return 0;
}
But when, instead of my_app object, I put there all of its data members (app
class has no constructor or destructor), it gives me no error!! I don't know
what to do. I don't know how to debug in Visual Studio and I don't know how
wheteher it would help me understand what's going on since my program relies
on some third party dll.
If your app class/struct didn't have a constructor or a destructor,
your program would not be compileable, let alone run. The error above
depicts trying to write to read-only memory. I can think of 10 or more
ways i could purposefully generate such an error. We could be here
until Christmas( year 2050 ) discussing what hypothetically might, or
might not be happening.
Notice: C++ programmers are notoriously pathetic at guessing.

I'ld suggest trying over at a newsgroup that deals with Visual Studio
and/or whatever proprietary GUI library you are using.

Consult this list of possible newsgroups:
[5.9] Which newsgroup should I post my questions?
http://www.parashift.com/c++-faq-lite/how-to-post.html

Dec 18 '06 #3
"r.z." <gk***@hjkjhk.plwrote in message
news:em**********@atlantis.news.tpi.pl
I commented out the third party functions and now I'm sure this error
is caused by this local object. But when I put there its data members
instead it gives me no error!!
You have two options: learn how to debug or post code here that is
compileable and allows us to reproduce the error.

Debugging this shouldn't be hard. Just hit F5 for starters (assuming you
have a debug build). With luck, this will take you to the line with the
error.

If the line with the error is in some library rather than your code, and you
are confident that the problem is in your code, then open the Call Stack
window (you should find it in the menus under Debug->Windows). Do this with
the Debugger still running. In the call stack, double click on the highest
line that is in your own code. The problem should be near this line.
--
John Carson
Dec 18 '06 #4
"r.z." <gk***@hjkjhk.plwrote in message
news:em**********@atlantis.news.tpi.pl
I commented out the third party functions and now I'm sure this error
is caused by this local object. But when I put there its data members
instead it gives me no error!!
I didn't realise what newsgroup I was in when replying.

You should ask questions like this in

microsoft.public.vc.language
or
microsoft.public.vc.ide_general
or
comp.os.ms-windows.programmer.win32
--
John Carson
Dec 18 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Alexey Kouzmitch | last post by:
Hi, I wrote a console application which is called from a SQL Server job. The application utilizes a COM object, to pump data from a legacy (no very old however) application to SQL server. The...
7
by: cppaddict | last post by:
Hi, I've been trying to debug a strange runtime error for the last 5 hours... I'm hoping someone might have an insight about it. I have an application that creates a vector of MyDisplay...
2
by: Lauren Wilson | last post by:
After upgrading to Access 2003 (from 2000) I now get a strange new runtime error on part of my longstanding Error handler code. This error ONLY happens when I try to run a new form with my same...
2
by: | last post by:
Let me explain step wise. 1.. I have a site running on port 5555 2.. If contains web.config file with contains <Forms> authentication. 3.. The site contains a sub-folder named "MembersArea"...
2
by: Piedro | last post by:
Can someone reproduce the following error? I'm using the module at the bottom of my post to owner draw a menu items, I call the module from a form like this: Private Sub mnuOpen_DrawItem(ByVal...
7
by: Kevin | last post by:
Hi, With this, i get the error: " Microsoft VBScript runtime error '800a01ca' Variable uses an Automation type not supported in VBScript " at line 79 <% totintot=request.cookies("totintot")...
11
by: Mike C# | last post by:
Hi all, I keep getting a strange error and can't pin it down. The message is: This application has requested the Runtime to terminate it in an unusual way. Please contact the application's...
1
by: Victor | last post by:
Hi guys, I have a very strange problem with scriptmanager here. I want to load a js (which is embed in the project) but everytime i try to load that, it gives me error like Specified argument was...
4
by: David | last post by:
I'm using the AxSHDocVw.WebBrowser control to download data from a webpage at work (it's an internal page on my company's intranet). The page produces a runtime error after a while and the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.