Results 1 to 4 of 4

Thread: Maybe stupid...but I want to know it.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    Belgium
    Posts
    87
    Yeah...hum

    Can somebody send me an example project of a dll because I want to know how to make my own dll's. I've never made a dll so please keep it easy. Or just give me the code for a dll that for example counts two integers up or something.

    tanks for helping a poor beginner!

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    You know what Classmodules are? Have you made OCX's before? ACtiveX Dll's are almost the same as ActiveX OCX's except that you have Classes, not Controls in it.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Member
    Join Date
    Nov 1999
    Location
    Princeton, New Jersey
    Posts
    46
    OK,

    Open VB, select ActiveX DLL.

    In the code for Class1 enter the following code:

    Public Function myfunction(txt)
    MsgBox txt
    End Function

    Next go to File and select "Add Project"... select Standard Exe.

    In Project Explorer, right click the Standard EXE project and choose "Set as Startup"

    Add a button to the form. In the code for the button:

    Private Sub Command1_Click()
    txt = "Hello World"
    Set s = CreateObject("Project1.Class1") 'create the COM object where Project1 is your ActiveX DLL and Class1 is your Class
    s.myfunction txt 'call the myfunction method of the DLL
    End Sub

    This is a VERY simple example. Once the DLL is finished you would register is on your machine using: regsvr32.exe c:\full\path\to.dll

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    Belgium
    Posts
    87

    thanks

    tanks for giving me my first lesson on how to make a dll!

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