I am new to interfacing a C# .exe project to native Visual-C++ DLL.
I can't figure out how to pass just a simple integer, and the following code results in a popup error about "PInvoke ... unbalanced the stack".
C++ DLL...........
extern "C"
{
__declspec(dllexport) void start_frame_generation( int& test_num )
{
Console::WriteLine ("test_num = " + test_num );
}
C# .......................
[DllImport("Ultrasound_Frame_Grabber.dll")]
public static extern void start_frame_generation( ref int test_num );
private void VNGuideViewForm_Load(object sender, EventArgs e)
{
int test_num = 123;
start_frame_generation( ref test_num);
}