I’m trying to marshal a VB6 structure but I don’t know how to marshal the Date type ex:
DateSaved As Date
and the following array of strings:
FASTNESSNAME(1 To 6) As String * 16
Thanks in advance for the help.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Dates in VB6 are very similar to dates in .NET (both are 8 bytes) so you should marshal as System.DateTime.
Fixed length strings and 1 based arrays are not supported as such in .NET. For the fixed length strings you could just use a custom .NET class?
As an addition to this you can use
<VBFixedString(20)>to define a fixed string, but this doesn’t work in the same way as you would expect in VB6. If you use this in a structure:And then use in your code – you can get differing results: