F
Finn Stampe Mikkelsen
Hi
I have a problem. I need to use routines i have previously called using
below code from Pascal :
PROCEDURE pGetVersionNr(
var AVersionNr : word); pascal; external 'raccd32a.dll';
PROCEDURE pCheckDatabaseFormat(
ADriveInfo : pointer;
var AResult : word;
var AErrorCode : SmallInt); pascal; external 'raccd32a.dll';
PROCEDURE pGetCallInfo(
DriveInfo: pointer;
ACall: pointer;
AInfo: pointer;
var AErrorCode: SmallInt); pascal; external 'raccd32a.dll';
Now i need to do this in C# and i have tried using this declaration:
[DllImport(@"M:\tsrDll\WIN32\raccd32a", EntryPoint =
"sGetVersionNr",
ExactSpelling = false, CallingConvention =
CallingConvention.StdCall)]
static extern void sGetVersionNr(ref int AVersionNr);
[DllImport(@"M:\tsrDll\WIN32\raccd32a", EntryPoint =
"sCheckDatabaseFormat",
ExactSpelling = false, CallingConvention =
CallingConvention.StdCall)]
static extern void sCheckDatabaseFormat(string ADriveInfo, ref int
AResult, ref int AErrorCode);
[DllImport(@"M:\tsrDll\WIN32\raccd32a", EntryPoint = "sGetCallInfo",
ExactSpelling = false, CallingConvention =
CallingConvention.StdCall)]
static extern void sGetCallInfo(ref string ADriveInfo, ref string
ACall, ref string AInfo, ref int AErrorCode);
sGetVersionNr and sCheckDatabaseFormat function okay. sGetCallInfo however
does not and i have an idea, that it is the use of pointer.
In Pascal i used this call to the dll : pGetCallInfo(@DriveInfo, @Call,
@Info, ErrorCode);
Here is the code i'm using now in C#:
sGetCallInfo(ref ADriveInfo, ref ACall, ref Ainfo, ref
AErrorCode); // Does NOT work
sCheckDatabaseFormat(ADriveInfo, ref AResult, ref AErrorCode);
// Works OKAY
Anyone?? Help will me much appreciated.. ;-))
/Finn
--
Der er 10 slags mennesker - Dem som forstår binær og dem som ikke gør.
There are 10 kinds of people. Those who understand binary and those who
don't.
Es gibt 10 Arten von Menschen. Die, die Binär verstehen, bzw. die, die es
nicht tuhen.
--
Der er 10 slags mennesker - Dem som forstår binær og dem som ikke gør.
There are 10 kinds of people. Those who understand binary and those who
don't.
Es gibt 10 Arten von Menschen. Die, die Binär verstehen, bzw. die, die es
nicht tuhen.
I have a problem. I need to use routines i have previously called using
below code from Pascal :
PROCEDURE pGetVersionNr(
var AVersionNr : word); pascal; external 'raccd32a.dll';
PROCEDURE pCheckDatabaseFormat(
ADriveInfo : pointer;
var AResult : word;
var AErrorCode : SmallInt); pascal; external 'raccd32a.dll';
PROCEDURE pGetCallInfo(
DriveInfo: pointer;
ACall: pointer;
AInfo: pointer;
var AErrorCode: SmallInt); pascal; external 'raccd32a.dll';
Now i need to do this in C# and i have tried using this declaration:
[DllImport(@"M:\tsrDll\WIN32\raccd32a", EntryPoint =
"sGetVersionNr",
ExactSpelling = false, CallingConvention =
CallingConvention.StdCall)]
static extern void sGetVersionNr(ref int AVersionNr);
[DllImport(@"M:\tsrDll\WIN32\raccd32a", EntryPoint =
"sCheckDatabaseFormat",
ExactSpelling = false, CallingConvention =
CallingConvention.StdCall)]
static extern void sCheckDatabaseFormat(string ADriveInfo, ref int
AResult, ref int AErrorCode);
[DllImport(@"M:\tsrDll\WIN32\raccd32a", EntryPoint = "sGetCallInfo",
ExactSpelling = false, CallingConvention =
CallingConvention.StdCall)]
static extern void sGetCallInfo(ref string ADriveInfo, ref string
ACall, ref string AInfo, ref int AErrorCode);
sGetVersionNr and sCheckDatabaseFormat function okay. sGetCallInfo however
does not and i have an idea, that it is the use of pointer.
In Pascal i used this call to the dll : pGetCallInfo(@DriveInfo, @Call,
@Info, ErrorCode);
Here is the code i'm using now in C#:
sGetCallInfo(ref ADriveInfo, ref ACall, ref Ainfo, ref
AErrorCode); // Does NOT work
sCheckDatabaseFormat(ADriveInfo, ref AResult, ref AErrorCode);
// Works OKAY
Anyone?? Help will me much appreciated.. ;-))
/Finn
--
Der er 10 slags mennesker - Dem som forstår binær og dem som ikke gør.
There are 10 kinds of people. Those who understand binary and those who
don't.
Es gibt 10 Arten von Menschen. Die, die Binär verstehen, bzw. die, die es
nicht tuhen.
--
Der er 10 slags mennesker - Dem som forstår binær og dem som ikke gør.
There are 10 kinds of people. Those who understand binary and those who
don't.
Es gibt 10 Arten von Menschen. Die, die Binär verstehen, bzw. die, die es
nicht tuhen.