How can I call this pointer functions?
# kotlin-native
g
How can I call this pointer functions?
b
.cPointer() ?
g
There is no function pointed(), there is a propery
pointed
g
Is this like you're supposed to do it?
g
Sorry, no, pointed doesn’t require memScope
Whjat is PathFindFileName? Kotlin String?
I’m not really sure what you try to achieve here, but yes, if you want pass pointer to Kotlin String, you use wcstr, cstr or any other converters first, to get C string and use pointer for it
and if you in memScoped you can use
ptr
extension
g
I'm trying to implement java's File.name on Windows platform. It's my first time using Kotlin native, so I don't quite know what I'm doing
g
I see, it’s a windows API
I think
PathFindFileName("somepath".cstr.ptr)
is what you need
not sure why it’s nullable, but maybe it’s fine
also not sure, should it be cstr or wsctr
m
use
PathFindFileNameW
or
PathFindFileNameA
instead
Actually it's bug in
cinterop
tool:
PathFindFileName
should be alias to
PathFindFileNameW
, not some weird pointer.
g
What's the difference between ``PathFindFileNameW`` and ``PathFindFileNameA``?
m
PathFindFileNameA
does not support unicode, so better always use functions with
W
endidngs.