469,623 Members | 1,439 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

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 2886
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by =?Utf-8?B?QmFkaXM=?= | last post: by
1 post views Thread by =?Utf-8?B?QmFkaXM=?= | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.