Results 1 to 3 of 3

Thread: [RESOLVED] activex dlls vb6

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Location
    Greater Manchester, UK
    Posts
    476

    Resolved [RESOLVED] activex dlls vb6

    Can activex dlls be used in vb6 as i cant find out how to call them and use functions, i've got some basic code to test with.

    The code in my activex dll(AdditionHelper.dll) in the(Addme.cls):
    Code:
    Public FirstNumber As Variant
    Public SecondNumber As Variant
    
    Function AdditionFunction(FirstNumber, SecondNumber)
        AdditionFunction = FirstNumber + SecondNumber
    End Function
    i'd like to know how to call this dll from my app to use the code

    thanks in advance

    chris1990
    If your question is answered then mark your thread RESOLVED and give credit to whoever answered it.

    If you fail, try and try again, its the only way to success.

  2. #2
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    Re: activex dlls vb6

    Replace it all with this:

    In your ActiveX dll class:

    Code:
    Function AdditionFunction(Byval FirstNumber as long, byval SecondNumber as long) as long
        AdditionFunction = FirstNumber + SecondNumber
    End Function
    -------

    In VB add:
    Code:
    Private testDLL as Object
    
    set testdll = createobject("dllname.className here")
    
    msgbox testdll.AdditionFunction(1,1)
    Note: This is off the head and untested.
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Location
    Greater Manchester, UK
    Posts
    476

    Re: activex dlls vb6

    thanks
    If your question is answered then mark your thread RESOLVED and give credit to whoever answered it.

    If you fail, try and try again, its the only way to success.

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