Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conversion of C declaration to VB

Status
Not open for further replies.

epmm001

Programmer
Nov 11, 1998
5
AU
Could anyone please help me to convert to following C code to VB. <br>
<br>
void Jumblo (char key[], /* Key for encryption / decryption*/<br>
char *input, /* Pointer to input buffer */<br>
int lenInput, /* Length of input buffer in bytes*/<br>
char *output, /* Pointer to output buffer */<br>
int encrypting,/* Encrypting (#0 yes) */<br>
int procFlag, /* Processing flag */<br>
/* 1 Blowfish only */<br>
/* 2 Jumble only */<br>
/* Otherwise Jumble and Blowfish */<br>
int newBuffer);/* Treating new buffer. */<br>
/* Normally set to 1 */<br>
<br>
I have tried to do what I considered normal conversion substituting Longs for the Int and String for the Char declaration.<br>
My declaration looks like this;<br>
<br>
Private Declare Sub JumBloB Lib "jumblo.dll" Alias "_JumBloB" (ByVal Key As String, ByRef inp As String, ByVal lenInput As Integer, ByRef output As String, ByVal encrypting As Integer, ByVal procFlag As Integer, ByVal newBuffer As Integer)<br>
<br>
I have tried many variations including changing ByVals to ByRefs but am still getting a 'Bad DLL calling convention' error.<br>
<br>
Any help with this problem would be much appreciated.<br>
<br>
Chris Benton
 
Chris,<br>
<br>
This is probably something you've done already, but have to ask. Have you looked at Daniel Appleman's VB guides to the Windows APIs? There's a 16-bit and a 32-bit, both of which have helped me greatly. <br>
<br>
If that's old news, have you perhaps tried sending the problem direct to Dan at (I think still) No guarantees, but he has responded to such posts in the past. Who knows, you might give him material to start a new book &lt;grin!&gt;. <br>
<br>
Sorry I couldn't help directly, and sorry if I've covered old ground.<br>
<br>
Make a good day . . .<br>
 
I can't test this without the DLL, but I'd changed the String ByRef's to Byval and pass fixed length strings (don't forget to Null Terminate them)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top