Hello,
could someone please help me out, i'm trying to call a Delphi 6.0 custom DLL
from inside of a C# windows project. what am i doing wrong? i use the
following declaration:
public class WindowDesignerForm : System.Windows.Forms.Form
{
[DllImport("calwin.dll", EntryPoint="CalcWindow",
ExactSpelling=false,CallingConvention=CallingConve ntion.StdCall)]
static extern double CalcWindow(long OrderNum, long WinNum);
etc...
}
I call the above dll like this inside a button click event:
double d = 0;
d = CalcWindow(or,wn);
The problem is that when i call this DLL nothing happens, it should display
a messageBox telling me what parameters i passed to the DLL. nothing appears,
and the return value is always 0. (I do not get any gpf's/access violations
when i call this code)
The delphi 6.0 code is as follows:
function CalcWindow(OrderNum:longint; WinNum: longint): double; stdcall;
Implementation
function CalcWindow(OrderNum:longint; WinNum: longint): double;
in the project source file, i export the dll like this:
exports
CalcWindow name 'CalcWindow';
I can call the dll from inside another Delphi exe, but inside the C# exe i
can't seem to get the same results, can somone spot what i'm doing wrong
with this?
Thanks.