I have created a small application in C# .NET 2008, in which i am trying to use VC++ .NET 2008 Dll.
In Dll, one class is created, in that one function and one variable are added.
In C#, Window form application, i have added VC Dll reference.
Now i can create object of Dll, but i am unable to access it function or variable.
It give error message as -
"____ does not contain a definition for ____ and no extension method ____ accepting a first argument of type _____ could be found (are you missing a using directive or an assembly reference)"
Posting here my code snippet
---------------------------------------------------------------
VC 2008 code -
#include "stdafx.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
namespace DllNameSp
{
public class Test
{
public:
int abc;
int iTest()
{
int z=0,x=0,y=0;
return z=x+y;
}
};
}
-------------------------------------------------------
C# code
private void Form1_Load(object sender, EventArgs e)
{
DllNameSp.Test obj1 = new DllNameSp.Test();
obj1.abc = 90;
int k = obj1.iTest();
}