473,409 Members | 1,970 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,409 software developers and data experts.

Attempted to read or write protected memory. C++ dll vs vb 2005

Hi experts,
i try to use vb.net 2005 call C++ dll, then give me "Attempted
to
read or write protected memory.This is often an indication that other
memory is corrupt". i have chk some message others people posted, but
since still cannot, pls give me some commnet.(this dll run smoothly at
vb 6 )

module:
' example
Declare Function TwTsxInitPar Lib "TSDKVC.DLL" _
(ByRef tsxparptr As Byte, ByVal asize As Long) As Long
Declare Function TwTsxParSetMaxTermLid Lib "TSDKVC.DLL" _
(ByRef tsxparptr As Byte, ByVal maxtermlid As Long) As Long
public sub run()
dim btsxpar(1024) As Byte
dim lnTerm as long
vtek.lRv = TwTsxInitPar(btsxpar(0), UBound(btsxpar) + 1)
<== msg popup PIvokeStackbalance was detected
vtek.lRv = TwTsxParSetMaxTermLid(btsxpar(0), lnTerm) <==
give same msg
............
end sub
after run the program ( console ) give
"Attempted to read or write protected memory.This is often an
indication that other memory is corrupt"
pls give advise, bcos i really have no any idea( vb6 can work )
many thanks

Jun 4 '06 #1
1 3121
iany...@gmail.com wrote:
Hi experts,
i try to use vb.net 2005 call C++ dll,


This is off-topic in this newsgroup, which deals with standard C++. See
http://www.parashift.com/c++-faq-lit...t.html#faq-5.9 for
newsgroup suggestions.
Jonathan

Jun 4 '06 #2

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

Similar topics

9
by: hiralparikh | last post by:
Hi, I am using .NET 2.0 and trying to use a function from a native DLL file. Here is the syntax that I am using: definition: public static extern String getPwd(String strServerName, String...
3
by: XJ | last post by:
Hi experts, i try to use vb.net 2005 call dll, then give me "Attempted to read or write protected memory.This is often an indication that other memory is corrupt". i have chk some message others...
2
by: Ilkka | last post by:
I have created an C++ application with Windows Forms, ADO and SQL server 2005. Now I need to change something and started debugging the code. Then suddenly I receive an error. "An unhandled...
2
by: Pieter | last post by:
Hi, Since 10 days (the first time was the 10th of november) I have some weird exception happening in an application here: All (except 1 of the total of 5) users had this error now 1 of 2 times...
1
by: =?Utf-8?B?QmFkaXM=?= | last post by:
Hi, I'm using automation to produce word documents, and it's working fine in my machine that have vs.net 2005 and office xp in it. BUT when I move my application to another machine that have...
1
by: =?Utf-8?B?QmFkaXM=?= | last post by:
Hi, I'm using automation to produce word documents, and it's working fine in my machine that have vs.net 2005 and office xp in it. BUT when I move my application to another machine that have...
2
by: adypoly | last post by:
Hi guys... I am having a typical problem in using one of the native dll in C# I'll explain what am trying to do, I've a dll written in C language which i am trying to include in my C# project,...
6
by: Scott Gravenhorst | last post by:
Windows XP SP3 My application is set to open a SaveFile dialog when an exit is requested. When I click the app's close button, the save dialog opens, but when I click to change the folder, the...
3
by: sriram347 | last post by:
Hi I am a newbie to ASP.NET. I developed a web page (project type is web application) and I keep getting this error. B]Error message : "System.AccessViolation Exception attempted to read or...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
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...
0
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...

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.