472,328 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,328 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 3040
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...
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...
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...
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...
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...
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...
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...
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...
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 :...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

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.