Thomas,
>This struct works fine together with the shell. But if I uncomment the two
>out commented lines, windows explorer crashes. I have absolutely no idea why
[quoted text clipped - 3 lines]
>
>Any suggestions? It's driving me crazy. The terminator seems to be the key.
How and in which context are you using the struct? Are you providing
PIDLs in for example a namespace extension, or are you just consuming
them?
Explorer doesn't care about the Size attribute you set in managed
code, it only cares about the cb member.
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
style - 06 Sep 2004 23:57 GMT
Hello Mattias
Exactly, I'm writing a namespace extension with C# and I'm desperately
trying to send my own pidls to Windows Explorer.
Of course I know, Windows Explorer only cares about the cb member. But if I
set cb to 6 bytes, I have to ensure nevertheless that the struct really has
a length of 6 bytes in unmanaged code - which you can control with the Size
parameter in [StructLayout(LayoutKind.Sequential, Size=6)]. Otherwise my
struct delivers wrong data. If my struct is marshalled, the data alignment
of my struct has to be correct, right?
For any reason there still seems to be something wrong with that. Any
further suggestions? I'd appreciate any help.
Best regards from Switzerland
Thomas
PS: Remove !spam. from the mail address to contact me.
.