Results 1 to 9 of 9

Thread: dll

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2001
    Posts
    163

    dll

    I have add a reference of access library into vb project and I could use of access function like

    a=nz(3,0)

    How could we do it in our own dll with out interface
    Purushottam

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Pardon? What do you mean without an interface?

    The dll's interface is it's properties and that is how you use it.

  3. #3
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Are you referring to late binding?

    Code:
       Dim objExcel As Object
       Set objExcel = CreateObject("Excel.Application")

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Nov 2001
    Posts
    163
    using access library we don't have to user interface and no need to create object simply we can use


    n=nvl(a,0)

    how can we do that when we make our own dll
    Purushottam

  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    I think what we are saying is to try and explain better. You just posted almost word for word what you did last time, but what does it mean? I realize there could be a language barrier here but anything you can do to explain would be great.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Nov 2001
    Posts
    163
    Actually I want to put all function into dll that I made in module
    so that other user could use it but couldn't see the codes.

    Suppose I have made a function in the module


    public function nvl(a,b as variant) as variant
    if isnull(a) then
    nvl=b
    else
    nvl=a
    end if
    end function



    Now I can use it my form

    private sub form1_click()
    dim a as variant
    a=null
    msgbox nvl(a,10)
    end sub




    similarly I want to write function in dll so that I could use it just like above event

    note
    (While including access lib I can user the function written in access )
    Purushottam

  7. #7
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    On the class module with all your functions in it change the instancing to Global MultiUse.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Nov 2001
    Posts
    163
    Thanks very much for your answer.But it will be very greatful if you show me an example how to do it.
    Thanks
    Purushottam

  9. #9
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Here you go although all I did was cut and paste the code you posted:
    public function nvl(a,b as variant) as variant
    if isnull(a) then
    nvl=b
    else
    nvl=a
    end if
    end function



    Now I can use it my form

    private sub form1_click()
    dim a as variant
    a=null
    msgbox nvl(a,10)
    end sub
    You'll either have to open both projects together (the grpDLL file) or you'll have to compile the dll and reassign the reference in the app project.

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