Results 1 to 3 of 3

Thread: Sample dll

  1. #1

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Sample dll

    Hi

    Someboy have a example dll very very simple, that show only a msgbox

    Using VB6


    Tia

    When I tried to execute show me error

    Code:
    Can't find DLL entry point timao in C:\TesteSap.dll
    Last edited by mutley; Feb 8th, 2011 at 09:41 AM.

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Sample dll

    VB6 does not create DLLs you declare as an API. It creates ActiveX DLLs, similar to ADO, DAO, FSO references you may have used. This means that you build your DLL then add it as a reference, not Declare it. Then in code, you create an instance of your dll's exposed class and call its functions/subs.

    So, for your example
    1. Create a new DLL project
    2. Make the class' Instancing property MultiUse if not already done.
    3. Give the class a more meaningful name besides Class1
    4. Add a public routine in that class the simply shows a message box
    5. Now create a new project and reference that dll project (or compile the DLL and reference it directly)
    6. Behind a button, Dim a variable as your DLL's class name. Set it to a New instance. Call its function
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Sample dll

    Also... to save you a lot of time and effort and heartache... in my sig is a link regarding Binary Compatibility ... I suggest reading it before you go too far and working with it... as you make changes to your DLL, even if it is a test one, it will make life a whole lot easier.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width