saania khan

saania khan

  • NA
  • 5
  • 0

Calling VC# dll functions in VC++

Oct 1 2006 3:28 PM
Hi,

I have a VC# dll created in Visual Studio 2005. I have added this to my VC++ (.NET) code and want to call a function in the dll. I dont know how to go abt it. I tried creating an instance of the class in VC# code, but that doesnt work......

My dll has the following code ..

namespace mcMath

{

public class Class1

{

private bool bTest = false;

///// <summary>

///// //This is a test method

///// </summary>

//public void mcTestMethod()

//{

//}

public long Add(long val1, long val2)

{

return val1 + val2;

}

/// <summary>

/// //This is a test property

/// </summary>

public bool Extra

{

get

{

return bTest;

}

set

{

bTest = value;

}

}

}

}

And I have added this dll as ...

#using "mcMath.dll"

in my VC++ file. Do I need to use DllImport here ?

Thanks,

Saania