Yeap; I didn't see the UnmanagedType.ByValTStr which is better than UnmanagedType.ByValArray in case of strings;
> -----Original Message----- > From: dotnet discussion [mailto:[EMAIL PROTECTED]]On Behalf Of > Andreas Häber > Sent: Monday, May 20, 2002 4:50 PM > To: [EMAIL PROTECTED] > Subject: Re: [DOTNET] How to marshal WChar[256] in COM interop? > > > Well.. I found the solution now :) > > Thanks for pointing me at the ByValArray Dumitru. That turned my attention > at the UnManagedType.ByValTStr which fixed the problem :) > > For anybody else wondering the solution was: > > [MarshalAs(UnmanagedType.ByValTStr, SizeConst=256)] > public string wszTitle; > > and now the big question.. why didn't I think of that in the first place? > ;-) > > Have a nice day and thanks for the help! > Andreas Häber > > You can read messages from the DOTNET archive, unsubscribe from DOTNET, or > subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.