A decent DLL tutorial

I need a good tutorial to start calling some DLLs

from VB5. Anyone got a good start point for me? The

help system for VB5 doesn't help. I need to know

what 'ByVal' and that stuff means.


  • I don't know where a tutorial is, but I'll tell you some info on calling dll's.

    Public Declare Function MyFunction Lib "MyDLL" Alias "1MyFunction" (ByRef FirstParam As Long, Optional ByVal SecondParam As String, Optional ByVal ThirdParam As Boolean = False) As Byte

    Public/Private - Determines whether the module the function is declared in is the only module that can call the function.

    Private - No other module can call this function.

    Public - All other module can call this function. Valid only in a module, not in a form.

    Function/Sub - Determines whether or not the function returns anything.

    Lib - The DLL containing the function.

    Alias - The name of the function in the DLL. Only neccesary if the function's name inside the DLL contains characters that VB does not consider valid for a function name. If Alias is supplied, you can call the function by pretty much any name you want as long as it doesn't conflict.

    ByRef/ByVal - Determines if the value of the variable is passed or the address of the variable. The default is ByRef, meaning the function can alter the value contained in the variable.

    Optional - Used to make a parameter optional so that the user doesn't have to put it in. Can contain a default value as indicated by the third parameter in the make-believe declare above.

    Hope this helps!

  • Calling DLLs is not easy. But you can start with easy ones. In VB5 you have the API Viewer. So from there you copy the declarations of API functions. I teach here one guy, his name Albert. Ask him about my lessons and if you'd like I will teach you some things in API functions. But I can't lead you through all the API functions because they are thousands. No-one, actually, can lead you through all it you just have to learn and to become an experienced programmer in API functions.

  • http://www.codearchive.com/

    and download apitutor.zip


    The API-Guide download page is located at


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!