VB Types in VB.Net

R

Rob Blackmore

Hi,

Can anyone let me know the best way to mimic the behaviour of VB Types
in VB.Net. I want to define a structure and then load / save data
into it from a binary file using FOPEN / FREAD etc... so I need to be
able to specify the size of the fields (mostly text). From what I can
see of the structure operator you cannot specify the size. I could
write code to manipulate a byte array of a stream object but don't
think that it should be that complex for what was a two line solution
in VB 6.0?


Thanks

Rob
 
L

Larry Serflaten

Rob Blackmore said:
Can anyone let me know the best way to mimic the behaviour of VB Types
in VB.Net. I want to define a structure and then load / save data
into it from a binary file using FOPEN / FREAD etc... so I need to be
able to specify the size of the fields (mostly text). From what I can
see of the structure operator you cannot specify the size. I could
write code to manipulate a byte array of a stream object but don't
think that it should be that complex for what was a two line solution
in VB 6.0?


See if this section helps:

http://msdn.microsoft.com/library/en-us/vbcn7/html/vaconDeclaringVariablesForRandomFileAccess.asp

LFS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top