Call C++ Exported Function in C#
I have the following C++ code:

	#pragma once
	#include "StdAfx.h"
	#include <string>
	using namespace std;
	using namespace System;


	extern "C" __declspec( dllexport ) string __stdcall GetVale()
	{
		return "test";
	}

I am trying to call this function in C# by doing this:

        [DllImport("Security.dll", CallingConvention = CallingConvention.StdCall, ExactSpelling = true, EntryPoint = "_GetVale@4")]
        internal static extern string Getvalue();

I am doing this just to learn and understand really. When I call this I get a PInvoke exception saying my CallingConvention is not correct. I am sure my mistakes in my files are very small. I know the entry point is "_GetVale@4" for I used a program to find it. If I can't change that to anything else it throws a entry point not found, so my problem is some where else.

What exactly am I doing wrong? Thanks!
Call C++ Exported Function in C#
===

I have the following C++ code:

	#pragma once
	#include "StdAfx.h"
	#include <string>
	using namespace std;
	using namespace System;


	extern "C" __declspec( dllexport ) string __stdcall GetVale()
	{
		return "test";
	}

I am trying to call this function in C# by doing this:

        [DllImport("Security.dll", CallingConvention = CallingConvention.StdCall, ExactSpelling = true, EntryPoint = "_GetVale@4")]
        internal static extern string Getvalue();

I am doing this just to learn and understand really. When I call this I get a PInvoke exception saying my CallingConvention is not correct. I am sure my mistakes in my files are very small. I know the entry point is "_GetVale@4" for I used a program to find it. If I can't change that to anything else it throws a entry point not found, so my problem is some where else.

What exactly am I doing wrong? Thanks!