The solution that ended up working was to return just an integer that
reported the final status of the dll. To return the float, a reference
was passed to the dll and then used by the C# application.
Example:
[DllImport(".\\testfloat.dll")]
static extern int testfloat([In, Out] float[] returnf);
float[] returnf = new float[] {0,0,0,0};
int status = testfloat(returnf);
be*****@excite.com (beto) wrote in message news:<7d**************************@posting.google. com>...
A am receiving an error when attempting to return a float from a C function.
The following is the C code
#define DLL __declspec(dllexport)
DLL float testfloat()
{
return 3.3;
}
The following is the C# code
[DllImport(".\\testfloat.DLL")]
static extern float testfloat();
float temp = testfloat();
Any help is appreciated.