VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   9555
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   9120
   LinkTopic       =   "Form1"
   ScaleHeight     =   9555
   ScaleWidth      =   9120
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   495
      Left            =   3960
      TabIndex        =   0
      Top             =   4560
      Width           =   1215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Private Type BITMAPFILEHEADER
        bfType As Integer
        bfSize As Long
        bfReserved1 As Integer
        bfReserved2 As Integer
        bfOffBits As Long
End Type
Private Sub Command1_Click()
    Dim FileHeader As BITMAPFILEHEADER
    FileHeader.bfType = &H4D42
    FileHeader.bfOffBits = Len(FileHeader) + 40
    FileHeader.bfSize = Len(FileHeader) + 40 + 1000
    
    Open "C:\UDT.txt" For Binary As #1
    Put #1, , FileHeader
    Close #1
    
    Dim bArr() As Byte
    ReDim bArr(LenB(FileHeader))
    CopyMemory bArr(0), FileHeader, LenB(FileHeader)
    Open "C:\ByteArray.txt" For Binary As #1
    Put #1, , bArr
    Close #1

End Sub
