473,807 Members | 2,853 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Application Error - Memory could not be "read"

Any help appreciated...

I am using a third party DLL file to access an HMI using ethernet. The function is declared in a VB module as:

'Read internal word address
Public Declare Function HKEtn_ReadInter nalMemory Lib "HKEserv.dl l" _
(ByRef dp As Int16, _
ByVal Wordcnt As Int16, _
ByVal DeviceType As Int32, _
ByVal addr As Int32, _
ByVal lpAddr As String, _
ByVal fg As Int32) _
As Int32

When I run this function in a single-threaded application, all is good. When I run the function in a multi-threaded application, I get an error message in a message box on closing the app:

myApplication.e xe - Application Error

The instruction at "0x6c3b5115 " referenced memory at "0x00000004 ". The memory could not be "read".

Click OK to terminate the program

Could the DLL be incompatible with .NET environment? Is it that I am not cleaning up some unmanaged resources?

I'm flat out of ideas...

Thanks...
--------------------------------
From: Ryan Linneman

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>9YQNf4HMtEy h7Rjyt0ZCUQ==</Id>
Nov 21 '05 #1
2 5193
Dear Ryan,

Show me a declaration for this API in header file. I guess
first argument is something wrong.

On Mon, 06 Jun 2005 23:14:43 -0700
Ryan Linneman via .NET 247 <an*******@dotn et247.com> wrote:
Any help appreciated...

I am using a third party DLL file to access an HMI using ethernet. The function is declared in a VB module as:

'Read internal word address
Public Declare Function HKEtn_ReadInter nalMemory Lib "HKEserv.dl l" _
(ByRef dp As Int16, _
ByVal Wordcnt As Int16, _
ByVal DeviceType As Int32, _
ByVal addr As Int32, _
ByVal lpAddr As String, _
ByVal fg As Int32) _
As Int32

When I run this function in a single-threaded application, all is good. When I run the function in a multi-threaded application, I get an error message in a message box on closing the app:

myApplication.e xe - Application Error

The instruction at "0x6c3b5115 " referenced memory at "0x00000004 ". The memory could not be "read".

Click OK to terminate the program

Could the DLL be incompatible with .NET environment? Is it that I am not cleaning up some unmanaged resources?

I'm flat out of ideas...

Thanks...
--------------------------------
From: Ryan Linneman

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>9YQNf4HMtEy h7Rjyt0ZCUQ==</Id>

---
MVP kaok = MVP.ChangeMvpCa tegory("for C# 2004-2005.");
kaok.Web = "http://www.antoine.st/";

Nov 21 '05 #2
Since it's a multi-threaded app, are you making sure that none of your
threads are still running when the app closes? Could one of the
threads be trying to access an object that is no longer available?

Nov 21 '05 #3

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

Similar topics

4
3437
by: Askari | last post by:
Yesterday, ALL code in python work and nothing when I close(finish) a code. Today, when I close, some raise this windows error : Instruction at "0x00FC3D70" use memory address "0x00000000". Can't be "read". Click on "OK" to exit program. Why this error, today and not before today?
10
2291
by: ZafT | last post by:
Thanks in advance for any tips that might get me going in the right direction. I am working on a simple exercise for school that is supposed to use read to read a file (about 10 MB). I am supposed to change the buffer size and see how this affects the read time. In other words, the buffer is supposed to limit how much of the file gets read per call, and cause some change in speed. I am supposed to do the same with fread as well, but...
2
3206
by: lyn.duong | last post by:
Hi, I've got this dts package in sql server 2000 sp4 that has several transformation tasks with an oracle database (10g) as the destination. The package executes successfully when run through the dts designer but when run using dtsrun, I get the following error at the completion of all tasks in the dts package. The data inserts into the oracle database but i always get this Application error The Instruction at "0x7c8327f9" referenced...
3
9591
by: Justin To via AccessMonster.com | last post by:
I just distributed a FE mde file throught my department, and while stress testing on the performance of the new release, 3 users got the following error: The instruction at ... referenced memory at ... The memory cannot be "read". this seems like a computer-local problem as I cannot reproduce the same error on any other computers I tried running Dr. Watson (win2k) and it says "Exception number: c0000005
0
2142
by: antsays | last post by:
I am trying to serialize a collection to disk using the code provided. This works just fine but when I try do copy and past the xml file to another location or sometimes even just click on the file it gives me the error: The instruction at "0x635e0719" referenced memory at "0x00000000". The momory could not be "read. Could anyone please help out with this
1
2895
by: Curten | last post by:
Hi, When I run a program I have made, i get this error message sometimes: "Application error:The instruction at '...' referenced memory at '...'. Memory could not be "read"..." Are there any common mistakes that cause this problem? Before i get the message above i get this in the command window: "pow: OVERFLOW error". I suppose these error messages are connected, but how? What causes pow: OVERFLOW error?
1
3999
by: suresh810in | last post by:
hi, I got thsi error --------------------------- VB6.EXE - Application Error --------------------------- The instruction at "0x0055a8ea" referenced memory at "0x608af85c". The memory could not be "read". Click on OK to terminate the program Click on CANCEL to debug the program ---------------------------
8
1900
by: eastcoastguyz | last post by:
I'm very new to RSS. I was given a URL that starts with "feed:". I want to be able to open this and read in its content into a PHP program to produce a report. I'm not interested in converting it to HTML. Question: Is a URL that starts with feed: output XML? Question: How do I open a feed: URL in PHP and parse it? Thanks!
1
3760
by: kamcap | last post by:
I have referenced a COM dll (unmanagged code) in a C# console application and this DLL is referenced in C# program using Interop facility in .NET. This dll actually a dataset/table which is written in Borland Delphi. static int Main(string args) { ClientVarDataSet vds = new ClientVarDataSet(); vds.XML = ""; vds.AddField("x", 3); //"x" field name and 3 field type
0
9720
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
9599
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
10626
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
10112
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...
1
7650
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
5685
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
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
3854
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
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.