471,348 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

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

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
Jul 21 '05 #1
2 2036

"Michael" <mi***********@solventgreen.com.nospam> schrieb im Newsbeitrag news:AA**********************************@microsof t.com...
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/de...filesample.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

Regards
Michael

Jul 21 '05 #2
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

"Andre Kaufmann" wrote:

"Michael" <mi***********@solventgreen.com.nospam> schrieb im Newsbeitrag news:AA**********************************@microsof t.com...
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/de...filesample.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

Regards
Michael


Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by johkar | last post: by
3 posts views Thread by TT (Tom Tempelaere) | last post: by
1 post views Thread by Ronak mishra | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.