Hello everyone,
I have created a little test project in a windows form app. It consists of 1 form (form1) and a class file (cities.vb)
It works perfectly fine as a Windows app, but when I try to convert it to a .dll, it states an error in my cities class file as "Error 1 Reference to a non-shared member requires an object reference." Ok. That's fine and dandy, I add the typical "dim form as new form1" in the cities class file, and it compiles to a .dll just fine. When I add the .dll to another project, and call the .dll, it doesn't perform the actions I need it to, and what works perfectly fine as a windows app, doesn't function as a .dll.
I have attached both the working and non-working files for your review. What am I missing? I just know it's something little. Or what am I doing wrong? Or what could be done better? Thanks for any help.
Kevin
Loading
Sam HobbsPosted Aug 14, 2011, 3:07 PM
You should create a database table of cities and each city would have a state and division. Then you could fill the states from the database and cascade the selection of a state to filling the combobox of cities. Then the selection of a city could result in a lookup of the division.
Another terminology is to call it master/detail in the sense that the states is a master and the cities are the detail. If you look for articles and samples of cascading and of master/detail then you are likely to get a faster start.
However, please don't call the project a DLL; it is a class library project. The term DLL implies regular DLL. Managed programs such as C# and VB .Net cannot create regular DLLs. VB programmers insist upon using the term DLL but Visual Studio does not call them DLL projects; they are Class Library projects. It helps to use meaningful terminology. In the context of VB, where it is clear that the DLL is created by VB and therefore is not a regular DLL, it is not confusing to call them DLLs but there is absolutely no reason why VB programmers must call them DLLs; not ever. It is simply a bad habit that can cause confusion.
VulpesPosted Aug 13, 2011, 4:00 PM
You can easily deal with this as follows: