Re: Transfer string data to unmanaged buffer

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Try using Buffer.BlockCopy() for the byte arrays, it is also faster than the
unmanaged code.

It wont work for fixed size buffers since they aren't proper arrays.


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
.



Relevant Pages

  • Re: COM Object Class Library Threading model
    ... should happily enter the MTA. ... Mattias Sjögren [C# MVP] mattias @ mvps.org ... Please reply only to the newsgroup. ...
    (microsoft.public.dotnet.framework.interop)
  • Re: ASCIIEncoding.GetString returns different values
    ... For random binary data, you should consider using Base64 encoding ... Mattias Sjögren [C# MVP] mattias @ mvps.org ... Please reply only to the newsgroup. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: one line struct initialization
    ... Well maybe you can get by with an implicit conversion operator ... Mattias Sjögren [C# MVP] mattias @ mvps.org ... Please reply only to the newsgroup. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Can someone explain this issue with nullable(of DateTime)...
    ... both Date arguments are flaged saying that: ... Mattias Sjögren [C# MVP] mattias @ mvps.org ... Please reply only to the newsgroup. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Windows Native Calls
    ... A call to a native (i.e. not managed code) function provided by for ... Mattias Sjögren [C# MVP] mattias @ mvps.org ... Please reply only to the newsgroup. ...
    (microsoft.public.dotnet.languages.vb)