Results 1 to 5 of 5

Thread: DLL

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Location
    Denmark
    Posts
    16

    Question

    Hey,


    I was wondering how I could export a set of routines into a .dll file...
    I don't want to just add the functions to my template dir
    And my .exe is growing in size, so I want to split the functions. And it'd be easier to debug... when I don't jump through all sorts of tested code!



    Thanks


    Thomas
    Teenage programmer
    VB6 Pro

  2. #2
    Guest
    To export them to a DLL, create a new ActiveX DLL and add the functions like you normally would to the module.

    Code:
    Public Sub Hello()
      
       MsgBox ("Hello")
    
    End Sub
    Then make a new Project, add Refrence to your DLL and use the code below to use it.

    Code:
    Private Sub Command1_Click()
    
        Dim myclass As Class1
        Set myclass = New Class1
        myclass.Hello
        Set myclass = Nothing
        
    End Sub

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Location
    Denmark
    Posts
    16

    Ok, but...

    Thanks, but isn't it possible to code a "decent" DLL ?

    So I can Declare Function About lib "MyDLL" ?




    Thomas
    Teenage programmer
    VB6 Pro

  4. #4
    Guest
    I have not tested it yet, but I believe you can do that. There is a lib file that is created when you make your DLL so use Project1 as your lib.

  5. #5
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655

    Wink

    Megatron:
    If you've added a reference then there is no reason to set your classes up... unless I missed part of your conversation and your doing something with a class elsewhere. Once you add the reference you can simply state:

    Code:
    Private Sub Command1_Click()
        Hello
    End Sub
    www.RealisticGraphics.net

    Running VS.Net Enterprise & VB 6

    Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML

    MSN Messenger: kmsheff

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