|
-
Oct 12th, 2002, 11:19 AM
#1
Thread Starter
Member
Visual C++ DLL won't work with VB
Didn't know where to post this as it's both VB and VC code, heres goes:
I have a DLL which contains this function:
void _stdcall cryptArray(unsigned char *bArray, long bArrayLen)
{
for (long i=0; i<=bArrayLen; ++i)
{
bArray[i]=bArray[i]^5;
}
}
To use this is Visual Basic, I call it with a procedure similar to this:
Public Declare Sub cryptArray Lib "C:\My Documents\Visual C++\XorEnc DLL\Debug\XorEnc DLL.dll" (Bytes As Byte, NumBytes As Long)
Dim Bytes(0 To 3) As Byte
For t = 0 To 3
Bytes(t) = t
Next
cryptArray Bytes(0), 4
When I do this I get a "Vb6 has caused an error..." in the above DLL.
Can anyone see where I've gone wrong?
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
|