Naveed Zaman

Naveed Zaman

  • 328
  • 5.5k
  • 1.5m

problem in interface in the DLL

Jun 5 2013 5:46 AM
I have created the interface with method "void update(int a , int b);" in dll file with one class which is class1 that class inherited interface it working fine. When I try to use that dll in another project after adding reference first create the object of that interface using "interface object = new class1"
After using object I can't see method which is define in interface.

code 1:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace InterfaceDLL
{
interface Icorebanking
{
void update(int a , int b);
}

public class Class1 : Icorebanking
{
private int c;
public void update(int a, int b)
{

c = a + b;
}
public int sum
{
get
{
return c;
}
}

}

}
another project.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using InterfaceDLL;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
Icorebanking objectinterface = new Class1();
objectinterface.
}
}
}


Answers (1)