473,756 Members | 3,390 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1441
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.p lwrote in message
news:em******** **@atlantis.new s.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.p lwrote in message
news:em******** **@atlantis.new s.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.publi c.vc.language
or
microsoft.publi c.vc.ide_genera l
or
comp.os.ms-windows.program mer.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
1488
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 application works fine, but once in a while it fails with the following message written to the event log: ----------------------------------------------------------------------- The description for Event ID ( 0 ) in Source ( .NET Runtime ) cannot...
7
1951
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 objects (MyDisplay is a custom class) and then uses them in various ways. The application has been compiling and running fine. Then I added a member variable of type enum to MyDisplay. So my class def now looks like this:
2
1424
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 old error handling code I've used for years. Here's the proc ... =================== BEGIN CODE ================== Private Sub Form_Open(Cancel As Integer) On Error GoTo Form_Open_Error
2
2104
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" which contains ss.aspx 4.. ss.aspx contains page_load event which prints Response.Write(Page.User.Identity.Name); 5.. Everything work proper untill here 6.. Now i want to have one more web.config file for folder "MembersArea" , I know i just...
2
2647
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 sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles mnuOpen.DrawItem Dim Ic As New Icon(Application.StartupPath & "\101_72.ico") DrawItems(e, mnuOpen, Ic) End Sub
7
4526
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
2493
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 support team for more information. However I'm not purposely requesting that the Runtime terminate in an "unusual way." The line that is causing me headaches is:
1
6998
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 out of the range of valid values. Parameter name: utcDate Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in...
4
2623
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 strange thing is that until the page is refreshed with Internet Explorer, the error keeps occurring. I realize no one can debug an application that I can't even provide details about (I didn't write nor do I have access to it) but what difference...
0
9271
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10031
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9838
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7242
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5140
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3354
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2665
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.