Re: DllImport - Problem
From: Andreas Weizel (doeners3002spameater_at_geekmail.de)
Date: 06/20/04
- Next message: QKai_v.d.P=FCtten=22?=: "Re: Datenbank-Beispiel"
- Previous message: Thomas Scheidegger [MVP]: "Re: Windows Form wird erst nach letzten Methoden angezeigt"
- In reply to: Christian Breit: "DllImport - Problem"
- Next in thread: Thomas Scheidegger [MVP]: "Re: DllImport - Problem"
- Reply: Thomas Scheidegger [MVP]: "Re: DllImport - Problem"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 20 Jun 2004 19:48:20 +0200
Hallo Christian
Christian Breit schrieb:
> void ConAlloc (unsigned char *Cid, char *TcpId, unsigned
> short HostPort, unsigned short PCPort, unsigned short
> Timeout, unsigned short SecFlag, unsigned short SecOff,
> long *rc);
>
> [...]
>
> [DllImport("lib.dll",
> CallingConvention=CallingConvention.StdCall)]
> public static extern void ConAlloc (StringBuilder CId,
> string sAdress, int iHostPort, int iPCPort, int iTimeOut,
> int iCheckPwd, int iWithoutSecurity, out int iReturnCode);
Der Datentyp "unsigned short" aus C++ entspricht in C# dem "ushort"
(bzw. System.UInt16) und besteht aus 16 Bits. Du verwendest stattdessen
den Typ "int", welcher 32-bittig ist. Vielleicht führt das zur Exception?
MfG
--
Andreas Weizel ("Rpinski")
http://www.awzhome.de/
- Next message: QKai_v.d.P=FCtten=22?=: "Re: Datenbank-Beispiel"
- Previous message: Thomas Scheidegger [MVP]: "Re: Windows Form wird erst nach letzten Methoden angezeigt"
- In reply to: Christian Breit: "DllImport - Problem"
- Next in thread: Thomas Scheidegger [MVP]: "Re: DllImport - Problem"
- Reply: Thomas Scheidegger [MVP]: "Re: DllImport - Problem"
- Messages sorted by: [ date ] [ thread ]