Your type mapping is wrong. The VB6 declaration is:
... (ByVal fxOrg As Double, ByVal fyOrg As Double, ByVal nSymbol As Long, ByVal nClr As Long) As Long
Type Characters - Visual Basic | Microsoft Docs[
^]
But
Long
in VB6 refers to a 32-bit integer. In .NET, that's an
Int32
, which maps to
Integer
in VB.NET and
int
in C#.
So to match your VB6 code, your C# declaration should be:
[DllImport("GSWDLL32.DLL", SetLastError = true)]
public static extern int GSSymbol(
double fxOrg,
double fyOrg,
int nSymbol,
int nClr
);