473,748 Members | 6,418 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

silly question about access violations

Hi guys,

might be a silly question, but i'm wondering whether it is even possible to
generate access violations when using C#?

I'm new at c# programming, but i have some experience with c++. Now that i'm
using c# i can't see how i should mess up memory like that without the use
of pointers or adresses.

Regards, Willem
Aug 7 '06 #1
2 1568
Hello, Willem!

WVmight be a silly question, but i'm wondering whether it is even
WVpossible to generate access violations when using C#?

WVI'm new at c# programming, but i have some experience with c++. Now
WVthat i'm using c# i can't see how i should mess up memory like that
WVwithout the use of pointers or adresses.

IMO you can do that using P/Invoke and COM interop in the unproper way and
maybe if you mess up something in the unsafe block...

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Aug 7 '06 #2
Hi,

It's much more difficult, but possible if using P/invoke.

The more common problem (not sure if quilify as access violations) is when
you try to invoke a member of an instance without being assigned first
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Willem Voncken" <se************ *@degr.comwrote in message
news:44******** **************@ news.xs4all.nl. ..
Hi guys,

might be a silly question, but i'm wondering whether it is even possible
to generate access violations when using C#?

I'm new at c# programming, but i have some experience with c++. Now that
i'm using c# i can't see how i should mess up memory like that without the
use of pointers or adresses.

Regards, Willem

Aug 7 '06 #3

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

Similar topics

7
10782
by: Bonnie R | last post by:
Hello! I am writing VBA code in Access 97 to import an Excel 2000 Spreadsheet. I had hoped to do this using ODBC, but that was not to be, for who knows what reason. The problem is that I import the excel file into a table in Access that I name X. Then I run an append query to import the data into another table. I get an error message that says it "can't append all the records" due
10
2258
by: sp | last post by:
I create an xml file in a text editor: <?xml version="1.0" encoding="utf-8"?> <elts> <elt id="1" class="c1">content1</elt> <elt id="2" class="c1">content2</elt> </elts> Then I load the file via xmlHttpRequest into xmlData variable. Why does xmlData.getElementById('1') return null and xmlData.firstChild.childNodes.className returns null also?
13
5326
by: mfreeman | last post by:
The minimal code (VB.NET 2003) needed to show this problem is shown below. All I do is loop through the records in the table and update them without making any changes. Out of 600 records, about 40 of them throw Concurrency violation errors in the update, and my GetAllColErrs function provides no output. In comparing the rows that throw errors with those that do not, I could find no pattern. It is obviously a bogus error, as the...
7
1273
by: Matt | last post by:
I've asked this question to some developers that are much more experienced than I, and gotten different answers --- and I can't find anything about it in the documentation. Dim vs. Private as a variable declaration What is the difference between the two (I strongly suspect there is none)
11
12405
by: gnortenjones | last post by:
I have a linked table (to an oracle db), and I am trying to run a simple update query against it to change some data, but I am getting the following error: "...didn't update 0 fields due to a type conversion failure, 24 records due to key violations, 0 records due to lock violations..." The table I'm updating has 4 primary key's, and I'm trying to update the data in one of them. The data I'm updating shouldn't violate the uniqueness of...
1
1789
by: Viperoptic | last post by:
Hi All I am doing an update query from MS Access on a few records. The update work once perfectly but a soon as I run it again it returns the error below... "I have 5 records that won't do what its told due to key violations Database didn't update 0 field(s) die to a type conversion failure, 5 record(s) due to key violations, 0 record(s) due to lock violations and 0 record(s) die to validation rule violations. " Is there anyway...
3
1814
by: Richard Weeks | last post by:
My question, stated as simply as possible, is: must a constraint violation, as defined by the standard, cause compilation to halt? I believe that in the presence of a constraint violation, at least one diagnostic is required, which, at the discretion of the compiler writer, may be either an "error" or a "warning." Generally however, an error halts compilation and a warning does not. This would seem to imply that it is up to the compiler...
11
2118
by: George2 | last post by:
Hello everyone, How do you understand the Bjarne's comments about exception specification? Especially, "not required to be checked across compilation-unit" and "violations will not be caught at run time"? section 14.6.1 Checking Exception Specifications --------------------
1
3762
by: billa856 | last post by:
Hi, I am trying to insert Null value in column(ShipDate) in my table.That column(ShipDate)'s type id date/time and format is short date. I am using "" to insert Null in that column(ShipDate) but it shows warning that customer can't append all the records in the append query. Customer set 1 field(s) to Null due to a type conersion failure,and it didn't add 0 record(s) to the table due to key violation, 0 record(s) due to lock...
0
8987
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8826
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
9534
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...
0
9366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9316
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,...
0
9241
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8239
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4597
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...
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.