I am having problems reading binary files
like .bmp's .avi's and .dcm (dicom medical image files)

Below is my first attempt to read the first couple of
bytes from the files

Dim data1, data2

File1.Open strFileName, fsModeBinary, fsAccessRead

File1.Get data1
File1.Get data2

MsgBox data1
MsgBox data2

File1.Close

MsgBox "done"

When I try this I either read in "empty" or I get an
error message "Invalid file format"

I haven't been able to get any good info on binary file
access. Can anyone help? Thank you


P.S.
Is there a way to specify byte position when you try to
read in a binary file

Re: Binary files using Embedded VB by Chris

Chris
Sat Sep 06 17:06:05 CDT 2003

Use the File APIs, not the File control. There's an article on DevBuzz with
all the declarations and examples.

-Chris


"Charlie" <cchiarelli@mountaincable.net> wrote in message
news:398201c374bd$6b4a53a0$a401280a@phx.gbl...
> I am having problems reading binary files
> like .bmp's .avi's and .dcm (dicom medical image files)
>
> Below is my first attempt to read the first couple of
> bytes from the files
>
> Dim data1, data2
>
> File1.Open strFileName, fsModeBinary, fsAccessRead
>
> File1.Get data1
> File1.Get data2
>
> MsgBox data1
> MsgBox data2
>
> File1.Close
>
> MsgBox "done"
>
> When I try this I either read in "empty" or I get an
> error message "Invalid file format"
>
> I haven't been able to get any good info on binary file
> access. Can anyone help? Thank you
>
>
> P.S.
> Is there a way to specify byte position when you try to
> read in a binary file