S
silentbazz
I have method in a Delphi library (Delphi 2007) that is declared thus:
function ReturnValuation(OurRef : integer) : double; export;
In my C# console application (Visual Studio 2005, .NET 2.0) I use the
DLLImport attribute to declare this method:
[DllImport(@"C:\PP\AutoValLibrary.dll", EntryPoint =
"ReturnValuation", CallingConvention = CallingConvention.StdCall)]
public static extern double ReturnValuation(int OurRef);
In my C# code I do the following:
int OurRef = 829366;
progress = ReturnValuation(OurRef).ToString();
However when I get the Delphi DLL to output the integer that has been
passed in, I see that it thinks it has been passed 9539304.
Quite simply I am confused as to why this is happening, I have tried
to simplify what's passed into the DLL as I know there are issues with
certain types between C# and Delphi, but I honestly thought I'd be
okay with an integer?
Can anyone spot what might be wrong with my code
function ReturnValuation(OurRef : integer) : double; export;
In my C# console application (Visual Studio 2005, .NET 2.0) I use the
DLLImport attribute to declare this method:
[DllImport(@"C:\PP\AutoValLibrary.dll", EntryPoint =
"ReturnValuation", CallingConvention = CallingConvention.StdCall)]
public static extern double ReturnValuation(int OurRef);
In my C# code I do the following:
int OurRef = 829366;
progress = ReturnValuation(OurRef).ToString();
However when I get the Delphi DLL to output the integer that has been
passed in, I see that it thinks it has been passed 9539304.
Quite simply I am confused as to why this is happening, I have tried
to simplify what's passed into the DLL as I know there are issues with
certain types between C# and Delphi, but I honestly thought I'd be
okay with an integer?
Can anyone spot what might be wrong with my code