Why does it cannot work?Could you tell me the mistake?
or tell me other methods that can use DLL.
Thanks very much!!!
Codes are below:
1)This is a dll code:
using System;
namespace myClassLib
{
public class myCL
{
public myCL()
{
}
public double Add(double i,double j)
{
return(i+j);
}
}
}
2)This is my mainframe:
using System;
using myClassLib;
namespace test1
{
.......
myCL cl=new myCL();
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void btn_equal_Click(object sender,System.EventArgs e)
{
double
js=3,bjs=2;
try
{
this.label1.Text=cl.Add(
js,bjs).ToString();
}
catch
{
}
}
}
Candle