Re: Convert (managed) FILETIME to (unmanaged) FILETIME

Tech-Archive recommends: Fix windows errors by optimizing your registry



That simply moves my dilemna inside the wrapper, which _is_
preferrable, but ultimately I still have to convert from
System::Runtime::InteropServices::FILETIME * to _FILETIME*. (since the
function ultimately being called takes a _FILETIME pointer.)

Right, but it's usually easier to handle it on the C++ side with
type-unsafe casts and memcpys.

In this case, however, since FILETIME is such a trivial struct, I
would simply declare a temporary (Win32) FILETIME variable, fill that
with the values from the managed struct (member by member) and pass it
on to the native code.


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