We want to pass a string to the vc++ from a csharp programme.
Following is the code : In C#
[DllImport("ConsoleApplication2.dll")]
public static extern int main_c(StringBuilder IpAddr, int p);
public string[] tcp()
{
StringBuilder buffer = new StringBuilder("192.168.1.100");
int i = main_c(buffer, 34318);
In vc++
extern __declspec( dllexport ) int main_c(char *peer,int port)
{
This gives a error as ":main_c' has unbalanced the stack." How can this be done ?