Calling Objects

Phylum

Centurion
Joined
Jun 20, 2003
Messages
105
Location
Canada
I have a form that wants to call another project (a class library to get a DLL). It then wants to execute that Project (DLL). How do I do this? I added a reference to the project and then tryed to define a variable of that type, but it dosen't work :(

Help?!?

Phylum
 
It's very easy with .NET.

  1. Build your DLL using the /t:library command-line switch.
  2. In your application code, add any using directives for namespaces defined in that DLL, if you fancy, and use the classes and methods in which you're interested.
  3. Build your EXE using the /r:MyDll.dll command-line switch.
    [/list=1]

    Voilà!

    (I don't know what magic you must perform in order to do this via your IDEs.)
 
How do I restrict the user to one instance of each DLL. For example:

I have a windows application form. On that form there is a button that calls the form of another DLL. If the user goes back to the original form and clicks the button again, they open up a new instance of the DLL's form. I want to prevent this?!?
 
There's only one instance of the DLL. You'll have to solve this problem in code, either or the client side or on the server side. (I can't really say which would be best without further details.)
 
Phylum said:
If the user goes back to the original form and clicks the button again, they open up a new instance of the DLL's form. I want to prevent this?!?

Just declare a new instance of the form from the DLL on the top of your code once and keep calling form.Show() where you have to without createing new objects.
 
Back
Top