Dll (urgent Plz) (1 Viewer)

dgoulston

Hasn't Got A Clue
Local time
Today, 05:02
Joined
Jun 10, 2002
Messages
403
ok i am trying to use a dll to decrypt some data. this is what i have soo far:


Option Compare Database

Declare Function DesConfigure Lib "c:\#\dndes.dll" ( EncrFlag As Integer, ChainType As Integer)

Declare Function DesDecrypt Lib "c:\#\dndes.dll" (ByVal InputBuf As String, ByVal OutputBuf As String)

'----------------------------------------------------------------------------------
Function decrypt()
Dim EncrFlag, ChainType As Integer
Dim InputBuf, OutputBuf As String
Dim tmp As String

ChainType = 0
EncrFlag = 0
OutputBuf = "AAAAAAAA"
InputBuf = "AAAAAAAA"

tmp = DesConfigure(EncrFlag, ChainType)
tmp = DesDecrypt(InputBuf, OutputBuf)

tmp = tmp
End Function

--------------------------------------------------------------------------

im gettin the run time error 49 "bad dll calling conversion"

desconfigure sets up the encryption and desdecrypt does the decrypting. it crashes at the tmp = DesConfigure(EncrFlag, ChainType) line, its being run from a macro just for testing purposes, as have never had to ues external dll's before


any more info needed i will be glad to provide..
thanks for the help

DAL
 
Last edited:

Travis

Registered User.
Local time
Yesterday, 21:02
Joined
Dec 17, 1999
Messages
1,332
I'm not familiar with the dndes.DLL, is this a Third Part Encryption DLL or an In-House DLL. In either case you may need to talk to the creator to find out what is wrong with your Declaration. See Quote from the MSDN below.

From the MSDN

Bad DLL calling convention (Error 49)


Arguments passed to a dynamic-link library (DLL) must exactly match those expected by the routine. Calling conventions deal with number, type, and order of arguments. This error has the following causes and solutions:

Your program is calling a routine in a DLL that's being passed the wrong type of arguments.
Make sure all argument types agree with those specified in the declaration of the routine you are calling.

Your program is calling a routine in a DLL that's being passed the wrong number of arguments.
Make sure you are passing the same number of arguments indicated in the declaration of the routine you are calling.

Your program is calling a routine in a DLL, but isn't using the StdCall calling convention.
If the DLL routine expects arguments by value, then make sure ByVal is specified for those arguments in the declaration for the routine.

Your Declare statement for a Windows DLL includes CDecl.
 

dgoulston

Hasn't Got A Clue
Local time
Today, 05:02
Joined
Jun 10, 2002
Messages
403
solved it, i jus put function instead of sub, stupid really, by the way it is an in house dll, and the creator is sittin behind me. lol he dont know much VB, hes a C++ developer


Option Compare Database
Declare Sub DesConfigure Lib "c:\#\dndes.dll" (EncrFlag As Long, ChainType As Long)
Declare Sub DesDecrypt Lib "c:\#\dndes.dll" (ByVal InputBuf As String, ByVal OutputBuf As String)

Function decryptit()
Dim EncrFlag, ChainType As Long
Dim Inputstr, Outputstr As String
Dim tmp As String

ChainType = 0
EncrFlag = 0
Outputstr = "AAAAAAAA"
Inputstr = "AAAAAAAA"

DesConfigure EncrFlag, ChainType
DesDecrypt Inputstr, Outputstr


End Function
 

Travis

Registered User.
Local time
Yesterday, 21:02
Joined
Dec 17, 1999
Messages
1,332
Thats not unuasual to find a C++ programmer behind a VB or VBA programmer :^)
 

dgoulston

Hasn't Got A Clue
Local time
Today, 05:02
Joined
Jun 10, 2002
Messages
403
im not really a VB/VBA programmer. im a VB/VBA/C++ programmer with VB/VBA/C++/C,Cobol,Modula 2, experience and Web Design skills.. lol,, jus im on a database project at the mo

hehe
and im only 19... god... lol

DAL
(jus bein a bit big headded here)
 

Users who are viewing this thread

Top Bottom