Can I somehow cast an Int to a String? The LoadCur...
# kotlin-native
t
Can I somehow cast an Int to a String? The LoadCursorW function accepts an
LPWSTR
argument, which gets turned into a
String?
argument by the interop wrapper, but you're supposed to be able to pass the predefined constant
IDC_ARROW
, defined like this:
Copy code
#define MAKEINTRESOURCEW(i) ((LPWSTR)((ULONG_PTR)((WORD)(i))))
#define IDC_ARROW MAKEINTRESOURCEW(32512)
Hm, it works if I copy the (private) definition of
kni_LoadCursorW
from the generated interop wrapper and change the
NativePtr
parameter to a
Long
. Is that a sensible way to do it?
Copy code
@SymbolName("win32_kni_LoadCursorW")
private external fun kni_LoadCursorW(hInstance: NativePtr, lpCursorName: Long): NativePtr
o
That's sensible workaround, in longer run we will come up with more generic solution for this problem