|
-
September 24th, 2001, 04:08 PM
#1
Problem passing pointer to dll
I have a VB program that calls a C++ dll and passes it a pointer to a byte.
I been able to make everything else work, the handles, strings, all of those, but when trying to pass a pointer I get a vb6.exe error saying the memory could not be read. I don't think it has anything to do with the C dll because I commented out all of the code inside the function to see if it was in there and still got the same problem.
I have a byte variable, I'm sending it byref and the c dll is supposed to write to that address.
Any ideas?
thank in advance
-
September 24th, 2001, 07:16 PM
#2
Re: Problem passing pointer to dll
try declare the parameter as any
HTH
cksiow
http://vblib.virtualave.net - share our codes
-
September 25th, 2001, 02:45 AM
#3
Re: Problem passing pointer to dll
You could try declaring it
byval lpByte as Long
and in the call, passing VarPtr(btMyVariable)
?
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
Check out the new downloads - ImageMap.ocx is the VB control that emulates an HTML image map, EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.
-
September 26th, 2001, 09:28 AM
#4
Re: Problem passing pointer to dll
Declare YourCFunction(byval bParm as byte) as whatever
private Sub CallFunction()
dim bVar(100) as byte
dim ret as whatever
ret = YourCFunction(bvar(0))
end sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|