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.
Printable View
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.
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)
Does that require the VB Array to be of type 'long'?
No. It's Long because Long has the same size as a pointer. The return value of VarPtr is Long.
thanks... sorry you had to tell me twice!