|
-
Oct 13th, 2002, 08:27 AM
#1
Thread Starter
Member
Passing a VB Byte Array into a C++ DLL
Can someone give me an example of how I can pass an array of Bytes (from VB) into a C++ DLL?
I know I've got to pass the length of the array, as well as the first array element (I think?). But I would appreciate an example to work from.
-
Oct 13th, 2002, 11:23 AM
#2
void __stdcall PassArrayTo(char *ar, long length);
Declare Sub PassArrayTo ... (ByVal ar as Long, ByVal len As Long)
'Call:
PassArrayTo VarPtr(array(1)), UBound(array)
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 13th, 2002, 11:39 AM
#3
Thread Starter
Member
Does that require the VB Array to be of type 'long'?
-
Oct 13th, 2002, 11:43 AM
#4
No. It's Long because Long has the same size as a pointer. The return value of VarPtr is Long.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 13th, 2002, 11:51 AM
#5
Thread Starter
Member
thanks... sorry you had to tell me twice!
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
|