Capaian ke halaman ini memerlukan kebenaran. Anda boleh cuba menukar direktori.
Marshalling Strings
Artikel
11/03/2022
Platform invoke copies string parameters, converting them from the .NET Framework format (Unicode) to the unmanaged format (ANSI), if needed. Because managed strings are immutable, platform invoke does not copy them back from unmanaged memory to managed memory when the function returns.
The following table lists marshalling options for strings, describes their usage, and provides a link to the corresponding .NET Framework sample.
Passes strings in a structure that is an In/Out parameter. The unmanaged function expects a pointer to a character buffer and the buffer size is a member of the structure.
Sumber untuk kandungan ini boleh didapati di GitHub, di mana anda juga boleh mencipta dan menyemak isu dan menarik permintaan. Untuk maklumat lanjut, lihat panduan penyumbang kami.
.NET
maklum balas
.NET
ialah projek sumber terbuka. Pilih pautan untuk memberikan maklum balas:
Marshal different array types, like integers by value or reference, 2-dimensional integers by value, strings by value, and structures with integers or strings.
Review how to marshal classes, structures, and unions. View samples of marshalling classes, structures with nested structures, arrays of structures, and unions.