Ceating dlls

Discussion in 'Programming General' started by X Zero, Apr 14, 2007.

Ceating dlls
  1. Unread #1 - Apr 14, 2007 at 5:21 AM
  2. X Zero
    Joined:
    Jan 21, 2007
    Posts:
    577
    Referrals:
    0
    Sythe Gold:
    0

    X Zero Forum Addict

    Ceating dlls

    ok, someone said i need vS 2005 to create dlls.

    i got a copy, all i need is the know how.

    can anyone help me out?

    edit: I can spell create
     
  3. Unread #2 - Apr 14, 2007 at 6:27 AM
  4. speljohan
    Joined:
    Apr 24, 2005
    Posts:
    1,450
    Referrals:
    3
    Sythe Gold:
    0

    speljohan Guru
    Visual Basic Programmers

    Ceating dlls

    create a class library. Write all code in there, and when you want to call it from another application, just add your DLL on references.
     
  5. Unread #3 - Apr 14, 2007 at 7:44 AM
  6. X Zero
    Joined:
    Jan 21, 2007
    Posts:
    577
    Referrals:
    0
    Sythe Gold:
    0

    X Zero Forum Addict

    Ceating dlls

    yep, got it

    is it possible to do something like (Main.Listbox1.items.add "lol")

    Because when i add it to the class i get error "Main is not declared"
     
  7. Unread #4 - Apr 14, 2007 at 1:00 PM
  8. speljohan
    Joined:
    Apr 24, 2005
    Posts:
    1,450
    Referrals:
    3
    Sythe Gold:
    0

    speljohan Guru
    Visual Basic Programmers

    Ceating dlls

    is main your dll? remember that vb.net is object oriented, so you will have to declare a new one like this:
    Code:
    Dim myLibrary As New Main()
    myLibrary.Listbox1.Items.Add("bwahaha")
    Also remember to have a constructor in the Main() class, like this:
    Code:
    Public Sub New()
    'put initialization code here (if you have any)
    End Sub
     
  9. Unread #5 - Apr 14, 2007 at 9:07 PM
  10. X Zero
    Joined:
    Jan 21, 2007
    Posts:
    577
    Referrals:
    0
    Sythe Gold:
    0

    X Zero Forum Addict

    Ceating dlls

    Let me rephrase


    is it possible to do something like (Form1.Listbox1.items.add "lol")

    Because when i add it to the class i get error "Form1 is not declared"
     
  11. Unread #6 - Apr 14, 2007 at 9:15 PM
  12. Flaming Idiots
    Joined:
    Dec 22, 2005
    Posts:
    235
    Referrals:
    1
    Sythe Gold:
    0
    Two Factor Authentication User

    Flaming Idiots Active Member
    Visual Basic Programmers

    Ceating dlls

    You need to use "Me" if the method is in the same form. If is from a module, use "My.Forms.{Forms name}".

    Edit: Since when did I have a VB programming rank?
     
  13. Unread #7 - Apr 14, 2007 at 9:43 PM
  14. speljohan
    Joined:
    Apr 24, 2005
    Posts:
    1,450
    Referrals:
    3
    Sythe Gold:
    0

    speljohan Guru
    Visual Basic Programmers

    Ceating dlls

    and since when did i lose my rank? :p
     
  15. Unread #8 - Apr 14, 2007 at 9:45 PM
  16. X Zero
    Joined:
    Jan 21, 2007
    Posts:
    577
    Referrals:
    0
    Sythe Gold:
    0

    X Zero Forum Addict

    Ceating dlls

    umm, i mean in the dll theres this code

    Code:
    Public Function ADD() As Integer Implements _Tester.ADD
    Form1.Listbox1.items.add "lol"
    End Function
    I want to add "lol" in a listbox using the dll

    but it says form1 not declerde

    how can i solve this?
     
  17. Unread #9 - Apr 14, 2007 at 10:01 PM
  18. speljohan
    Joined:
    Apr 24, 2005
    Posts:
    1,450
    Referrals:
    3
    Sythe Gold:
    0

    speljohan Guru
    Visual Basic Programmers

    Ceating dlls

    the DLL doesn't know what form that is.

    Code:
    Public Function ADD(control As ListBox) As Integer Implements _Tester.ADD
    control.items.add "lol"
    End Function
    Use it that way instead, and call it like:
    ADD(listbox1)
     
  19. Unread #10 - Apr 14, 2007 at 10:30 PM
  20. X Zero
    Joined:
    Jan 21, 2007
    Posts:
    577
    Referrals:
    0
    Sythe Gold:
    0

    X Zero Forum Addict

    Ceating dlls

    u got the idea right

    yer but now it says "listbox not defined"

    waaaaaaaaaaaaaaaaaaaaaaaaa
     
< SmoothMouse (better then my last one) | Rounding up >

Users viewing this thread
1 guest


 
 
Adblock breaks this site