Forms within a DLL

bgengine

New member
Joined
Jul 12, 2014
Messages
3
Programming Experience
1-3
Hi - I've done a bit of VB.net programming but am still learning ..
I want to create a .net DLL which I will call from another application (NS Teststand).
When I call the Dll -
1. I will need to pass a string to it,
2. It must show a form,
3. display the string in the form
4. then ask a user to type something into a text box ( also on the form) and click an OK button.
5. when the Ok button is clicked the form should close and return the data in the text box.

I can setup the dlll - with a form inside ....textbox ., buttons etc... but am not sure how to call the dll and how to open the form inside the dll, then pass the string to it and return the textbox text from it ..back to the Dll caller

Does anyone have any sample code I could look at ?
appreciate your help in advance.
B.
 
Is that NS Teststand a third-party app or something that you've created? Is it .NET too or not? How does/will it invoke the DLL?

thanks for the response,

I guess I should make this simpler for a start and say for now I'll use vb.net code to call the Dll (as well as create the Dll with vb.net code) ... might it easier to start with..

does anyone have any sample code of a dll with a form in it ...and doing something similar to what I'm looking for ... and then how would you call it from a vb.net project.

regards
 
If it's your VB.NET application that will be using the DLL, is there any reason that you can't reference the DLL in your project? You can load a DLL at run time but that should only be done if you specifically can't reference it at design time.
 
If it's your VB.NET application that will be using the DLL, is there any reason that you can't reference the DLL in your project? You can load a DLL at run time but that should only be done if you specifically can't reference it at design time.

Hi,
would you have an example of how. To do this ?
thanks
 
Hi,
would you have an example of how. To do this ?
thanks

So, does that mean that there isn't any reason that you can't reference the DLL that you're aware of? If there is no impediment to doing so then you treat it just like any other library, including those in the .NET Framework. Open the References page of the project properties and add any assembly references and namespace imports there. You might like to follow the Blog link in my signature below and check out my post on Assemblies & Namespaces for more info. Once the library is referenced, you access the types it contains like any other. Every type you already use from the .NET Framework, e.g. String, Integer and Form, are defined in DLLs.
 
Back
Top