Kernel32CompareStringOrdinal(IntPtr, Int32, String, Int32, Boolean) Method
Compares two Unicode strings to test binary equivalence.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", SetLastError = true)]
public static int CompareStringOrdinal(
IntPtr string1,
int length1,
string string2,
int length2,
bool ignoreCase
)
<DllImportAttribute("Kernel32.dll", SetLastError := true>]
Public Shared Function CompareStringOrdinal (
string1 As IntPtr,
length1 As Integer,
string2 As String,
length2 As Integer,
ignoreCase As Boolean
) As Integer
Dim string1 As IntPtr
Dim length1 As Integer
Dim string2 As String
Dim length2 As Integer
Dim ignoreCase As Boolean
Dim returnValue As Integer
returnValue = Kernel32.CompareStringOrdinal(string1,
length1, string2, length2, ignoreCase)
public:
[DllImportAttribute(L"Kernel32.dll", SetLastError = true)]
static int CompareStringOrdinal(
IntPtr string1,
int length1,
String^ string2,
int length2,
bool ignoreCase
)
[<DllImportAttribute("Kernel32.dll", SetLastError = true)>]
static member CompareStringOrdinal :
string1 : IntPtr *
length1 : int *
string2 : string *
length2 : int *
ignoreCase : bool -> int
No code example is currently available or this language may not be supported.
- string1 IntPtr
-
The first string to compare.
- length1 Int32
-
Character length of the string indicated by string1 parameter.
If this value is '-1', the function determines the length automatically.
- string2 String
-
The second string to compare.
- length2 Int32
-
Character length of the string indicated by string2 parameter.
If this value is '-1', the function determines the length automatically.
- ignoreCase Boolean
-
True: performs a case-insensitive comparison.
False: performs a case-sensitive comparison.
Int32
Returns one of the following values if successful:
1 (CSTR_LESS_THAN):
string1 is less than
string2.
2 (CSTR_EQUAL):
string1 is equals to
string2.
3 (CSTR_GREATER_THAN):
string1 is greater than
string2.
If the function fails, the return value is zero.
To get extended error information, call
GetLastWin32Error.