Re: [2008] Help with DLLS
Your post is a little confusing but it sounds like you are just putting variables in a dll project?
when you make dlls you put classes in them, which you instantiate like normal, or give them 'public shared' functions etc for use without an instance.
Basically, a dll project is essentially no different from just having class files in your project, except that they are kept in different namespaces (can have diff references etc) but you go about using them the same way.
Re: [2008] Help with DLLS
You shouldnt be trying to fill these "public variables" from your program. Create some Public Properties or Functions/Methods and fill / access them from there.
1 Attachment(s)
Re: [2008] Help with DLLS
Ok Well it doesn't seem to work Here is whats in my DLL:
Authentication.Class
Code:
Public Class Authentication
Public AuthenticationType As Integer
Public Username As String
Public Password As String
Public Level As String
Public DatabasePath As String
Public Authenticated As Boolean
Public Sub Authenticate()
' MY WORKING CODE GOES HERE
End Sub
End Class
Then I simply open my main project Add Reference to it then open my form and try to use the DLL. It sees the DLL but I am not sure how to use it. I have attached a screenshot to show you what my form does when I try to use it. Its prob just me being stupid. If I used it like I normally do:
Code:
MyVarible = ThisValue
And I would normally just put that in the form where the varible is in a Module
when I do that here it just says its not declared.
My mate is a profressional programmer and he said there was a little bit of code that needs to go at the top of the dll in order for vb.net to be able to use varibles in it.
Re: [2008] Help with DLLS
Don't Worry I have managed to do it myself playing around with it. I have never really used classes or DLLs so playing around I managed to do it. For those of you in my situation which will prob be none I had to do this:
Inherits Global.DLL.CLASSNAME
So in my case it was:
Inherits Global.Authentication.Authentication
Because my DLL Project was called Authentication and My class in the DLL was called Authentication. :-)
Re: [2008] Help with DLLS
Ok, but I still stand by my post that its not the best design logic to use for a dll. A dll should be just functions, methods and subs. ;)
Re: [2008] Help with DLLS
Nope its messed it up. Iafter adding tht code my actual form as just gone. I only have the code to the form and i can't seem to get it back. I have just lost two whole forms. Anyway of getting it back?
What the hell have I done wrong?
RobDog888 Please could you give me examples of what you mean and how to do it as it doesn't make much sense to me. I am prob seeming really dumb right now but its something I need to get done.
Thanks.