using LSET to load records into types in VB6 - how to do in .NET

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
In VB6 I wrote an application that had to read lots of fixed length disk
records from another system. These records were divided up into many fixed
length fields.

In VB6 the easy solution to breaking up the record into the fields was to
define all the fields in a VB6 Type as fixed length strings and then use Lset
to load the record into the type - worked a treat.

However this won't work in .NET - and I haven't see any easy alternative.

Any ideas ?

Regards
Michael
 
Michael said:
Hi,
In VB6 I wrote an application that had to read lots of fixed length disk
records from another system. These records were divided up into many fixed
length fields.

In VB6 the easy solution to breaking up the record into the fields was to
define all the fields in a VB6 Type as fixed length strings and then use Lset
to load the record into the type - worked a treat.

However this won't work in .NET - and I haven't see any easy alternative.

Any ideas ?

Perhaps the following MSDN article about marshalling a structure with fixed length
arrays will help you:

http://msdn.microsoft.com/library/d...ry/en-us/cpguide/html/cpconfindfilesample.asp

Another solution would be to use the VB6 application and export some Read methods, via
COM and using COM interop in the .NET application

Hope that helps.
Andre
 
Andre,
Thanks for that - but specifying the fields as fixed length strings via
marshalling I had already figured out.

The question is - how to get a fixed length disk record loaded into that
type ?

Regards
Michael
 
Back
Top