Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Conversion of C declaration to VB

Conversion of C declaration to VB

Conversion of C declaration to VB

Could anyone please help me to convert to following C code to VB.

void Jumblo (char key[], /* Key for encryption / decryption*/
char *input, /* Pointer to input buffer */
int lenInput, /* Length of input buffer in bytes*/
char *output, /* Pointer to output buffer */
int encrypting,/* Encrypting (#0 yes) */
int procFlag, /* Processing flag */
/* 1 Blowfish only */
/* 2 Jumble only */
/* Otherwise Jumble and Blowfish */
int newBuffer);/* Treating new buffer. */
/* Normally set to 1 */

I have tried to do what I considered normal conversion substituting Longs for the Int and String for the Char declaration.
My declaration looks like this;

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)

I have tried many variations including changing ByVals to ByRefs but am still getting a 'Bad DLL calling convention' error.

Any help with this problem would be much appreciated.

Chris Benton

RE: Conversion of C declaration to VB


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.

If that's old news, have you perhaps tried sending the problem direct to Dan at (I think still) www.desaware.com? No guarantees, but he has responded to such posts in the past. Who knows, you might give him material to start a new book <grin!>.

Sorry I couldn't help directly, and sorry if I've covered old ground.

Make a good day . . .

RE: Conversion of C declaration to VB

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)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close