Re: Possible causes of Err 483 "Can't find DLL entry point"?

From: Fred (fred_at_acme.com)
Date: 10/02/04


Date: Sat, 02 Oct 2004 13:56:36 +0200

On Fri, 1 Oct 2004 22:00:06 -0500, "Ralph"
<msnews.20.nt_consulting32@spamgourmet.com> wrote:
>Because of the underscore you will have to use the Declare Function
>directive with the alias. It also appears the author is using _stdcall. But
>that is about as far as I can go with any advice.

Suspecting this, I tried both Declare's, but neither works. The author
confirms that the DLL was compiled as _stdcall (which is unsual, as it
seems like most Windows C developers use _cdecl).

>Your declare directive looks reasonable.

But then, the author tells me that the filename (1st param) is
Unicode, while the buffer will receive bytes (if my reading of
Appleman's book servers, I seem to recall VB doing some Ansi to
Unicode kung-fu when calling a C DLL, so that could be an issue, but
since it's err 483, I assume the error is triggered before even trying
to pass parameters.

>How are you calling the function? What does your VB code look like?

Damn, forgot to copy the code on my ZIP drive when leaving the office
:-) But from memory...

Private Sub Form1_DblClick()
        Dim sFile as String
        Dim lBinary as Long

        'DLL writes into string, so must allocate space
        Dim sHash as String * 256

        Dim lLen as Long
        Dim lLock as Long
        Dim lRet as Long
        
        lRet = md5_lib (sFile, lBinary, sHash, lLen, lLock)

End Sub

"Here is dumpbin output for the version of md5lib.dll at
http://users.erols.com/gmgarner/forensics:

        1 0 00002330 __md5_stream@12
        2 1 000019C0 _is_equal_md5@16
        3 2 00001000 _md5_alloc_ctx@0
        4 3 00002430 _md5_buffer@16
=> 5 4 000024D0 _md5_file@20
        6 5 00001F50 _md5_finish_ctx@12
(snip)

The C header file is included in the source distribution at
http://users.erols.com/gmgarner/forensics. Functions use the
__stdcall calling convention."

I don't know enough about C, and the intricacies about calling a C DLL
from VB to be able to solve that one, but since the DLL is pretty
small, and open-source, I guess I'm not the only one who would benefit
from being able to call it from VB on any Windows platform.

Thank you
Fred.



Relevant Pages

  • Re: using the CWegPage.dll
    ... It is using the WINAPI (_stdcall) calling ... > The source code for the DLL is on that page and is in this link to the zip ... >> change the calling convention to that which VB can handle. ... >>> The goal is to put an internet explorer web browswer on my form. ...
    (microsoft.public.vc.language)
  • Re: using the CWegPage.dll
    ... It is using the WINAPI (_stdcall) calling ... > The source code for the DLL is on that page and is in this link to the zip ... >> change the calling convention to that which VB can handle. ... >>> The goal is to put an internet explorer web browswer on my form. ...
    (microsoft.public.vb.winapi)
  • Re: How to export afunction in class?
    ... but I rarely find that I need stdcall when calling the exported functions of a DLL. ... I'll trade off performance vs. convenience at this level any time, ...
    (microsoft.public.vc.mfc)
  • Re: Calling procedure in a DLL
    ... but I get errors when calling the ... library TestLib; ... And where is that told to use StdCall? ... If you want to know why, then it is because it stops your DLL being ...
    (alt.comp.lang.borland-delphi)
  • Re: Mixed stdcall and cdecl code
    ... >> convention. ... I link to a 3rd party static library that apparently uses the ... >> errors from the linker until I changed my project settings from stdcall ... The 3rd party did not explicitly declare a calling convention in ...
    (microsoft.public.win32.programmer.directx.video)

Loading