473,405 Members | 2,262 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,405 software developers and data experts.

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_ReadInternalMemory Lib "HKEserv.dll" _
(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.exe - 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>9YQNf4HMtEyh7Rjyt0ZCUQ==</Id>
Nov 21 '05 #1
2 5173
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*******@dotnet247.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_ReadInternalMemory Lib "HKEserv.dll" _
(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.exe - 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>9YQNf4HMtEyh7Rjyt0ZCUQ==</Id>

---
MVP kaok = MVP.ChangeMvpCategory("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
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...
10
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...
2
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...
3
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...
0
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...
1
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...
1
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...
8
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...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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,...
0
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...
0
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,...
0
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...
0
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...

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.