Results 1 to 5 of 5

Thread: own DLL how to use it in my code

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2003
    Posts
    68

    own DLL how to use it in my code

    Hello,

    I have created a DLL with different classes created by myself.

    So I can use it with all my new progs.

    In a new program I reference the DLL and it appear in the reference folder fine.

    But when I try to create an objet of a class of the DLL it does know it ?

    example : dim x as new MyClassInDLL()

    error : MyClassInDLL not defined !

    I suspect the DLL to be corrupted because when I use Object explorer to view the content of the DLL I didn't see anything.

    What I have done is created a class in a VB file and tested it with a other project with a form. work fine.

    I have exclude the test project from the solution and select embended ressource in compile option of the VB file and build the solution.

    A DLL has been created in the Bin folder.


    Maybe I have done something wrong ???

    Can you help me ?

    Thanks

  2. #2
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    try importing it as well at the top of your page as well as referencing it:

    imports nameofdll

    did you make the sub routines in the dll public?
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    If your class are public then it should work fine . Otherwise , show us your dll structure (no need for the rest of the code) ex :
    VB Code:
    1. Public class class1
    2.  
    3. public sub a()
    4.  
    5. end sub
    6.  
    7.  
    8. public sub b()
    9.  
    10. end sub
    11.  
    12.  
    13. end class
    14.  
    15.  
    16. public class class2
    17.  
    18. 'etc
    19. end class

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Also DLLs are 'Class Library' protect types not embedded resources. An embedded resource is something entirely different, although if you successfully made a reference to it then you probably got that part right.

  5. #5
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Guys, dont forget the Namespace. All projects have a default Namespace hich you also have to specifiy

    myprojectname.classname
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

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