I had to change this some, probably because I'm not using 2005 yet. I wound
up doing this:
char * guidData = static_cast<char*>(const_cast<void*>(static_cast<c onst
void*>(Marshal::StringToHGlobalAnsi(Convert::ToStr ing(guid.ToByteArray())))));
void __pin *data = &(guidData[0]);
Everything seems to be working. Thanks for the jump-start.
Lee
"Brian Muth" <bm***@mvps.org> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
Guid^ g = gcnew Guid ("B6806700-E2B1-4022-9D4B-B0205CB37935");
array<System::Byte>^ a = g->ToByteArray();
_GUID guid;
Marshal::Copy(a, 0, IntPtr(&guid), a->Length);
Note, I'm using VS 2005.
Brian
"Lee Crabtree" <lc*******@goisi.com> wrote in message
news:uu**************@tk2msftngp13.phx.gbl... I've been wrapping an unmanaged class, and everything has gone well.
That is...until now.
I've hit a wall while trying to marshal the System::Guid type down into
the unmanaged GUID structure that the unmanaged class asks for. For some
reason, none of my attempts to date have met with success. Maybe someone
else has an idea how this works?
Lee