If you are looking for a higher-level answer than I have given you, please let me know.
1. Create a WinForms app (EXE) and add a reference to the class library (DLL) if your using VS.NET.
If your not using VS.NET, just build your EXE with a compiler switch that references your DLL
2. To invoke a method in the DLL you have a few options:
A. Create a class in the DLL that has a static method
B. Create a class in the DLL that has an instance method, and create an instance of the class from your EXE code
Here's an example in C# of using a static method:
/// WinForms code:
using DLLNamespace;
public namespace EXENamespace
{
public class EXEClass
{
static void Main() // app entry point
{
DLLClass.ShowWindow();
}
}
}
// Class Library Code:
using System.Windows.Forms; // this is a reference to a namespace found in a class library of the same name
public namespace DLLNamespace
{
public class DLLClass
{
public static void ShowWindow() // marked as 'static' so that you don't have to create a 'DLLClass' instance
{
MessageBox.Show("Here's a window, popped-up using code written in a class library");
}
}
}
--
Dave Sexton
dave@www..jwaonline..com
-----------------------------------------------------------------------
"Tony" <To**@discussions.microsoft.com> wrote in message news:DA**********************************@microsof t.com...
If I create a WinApp (EXE) and a ClassLibrary (DLL), how do I call a class
'say' that displays a WinForm in the ClassLibrary from the WinApp?
TIA