I have upgraded some VB6 code, which uses fixed length strings in custom types, to VB .NET by using the UpgradeWizard and am having trouble with the use of the LSet method t
LSet is a rather quirky statement in VB6: see description in the manual.
It's being used in a particularly quirky way in the code you have.
LSet instOfMyTypeBuffer.Buffer = ...
instOfMyTypeBuffer.Buffer = ...
LSet instOfMyType = instOfMyTypeBuffer
instOfMyBuffer
into instOfMyType.PROP1
and the remaining 25 characters into instOfMyType.PROP2
.instOfMyType.PROP1 = Left(instOfMyBuffer.Buffer, 15)
instOfMyType.PROP2 = Mid(instOfMyBuffer.Buffer, 16)
Hans suggested ditching the fixed-length strings. If that's easy - and it depends on the rest of your code base, it might be easy, or it might be hard - it's good advice.