Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

BinaryWriter in VB6

Is it possible to write one class as like as BinaryWriter?
Can anyone show me some example coding?
Thank you.
[117 byte] By [Sync] at [2007-11-11 8:03:48]
# 1 Re: BinaryWriter in VB6
what is a BinaryWriter? Something that writes in a file in binary mode? Something that copy a memory area into another?

Marco
mstraf at 2007-11-11 17:26:07 >
# 2 Re: BinaryWriter in VB6
>>Something that writes in a file in binary mode?
Yeah.

BinaryWriter is one of .NET Classes. (System.IO.BinaryWriter). I don't want to use this .NET Class from VB6. I found cool class library called VBCorLib but It's very huge amount of coding so that I'm looking for small class which can be used in writing Binary File.
Sync at 2007-11-11 17:27:07 >
# 3 Re: BinaryWriter in VB6
This task is fact is much easier to do in vb6 than .NET... just open the file as Binary and write the data with the Put statement:

Open "c:\myFile" For Binary Access Write As #1
put #1,,myData
Close #1

Marco
mstraf at 2007-11-11 17:28:05 >
# 4 Re: BinaryWriter in VB6
great.
Thank you so much. :-)

Will this file generated by above code and the file genearted by System.IO.BinaryWriter be the same?
Sync at 2007-11-11 17:29:10 >
# 5 Re: BinaryWriter in VB6
oh... that I do not know! Use dumphex or some other binary utilities to examinate and compare the content of the files. The Put statement just write the data in whatever binary format is stored.
Marco
mstraf at 2007-11-11 17:30:09 >
# 6 Re: BinaryWriter in VB6
Thanks. mstraf
Sync at 2007-11-11 17:31:05 >