Write Resource To File - Fast!
This is a fast way to write a resource to a file. UPDATE: You can find an example to this code here.
AI
Ringkasan AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Kode Sumber
Public Sub ResToFile(Filename As String, ResID As Variant, ResType As Variant, Optional Overwrite As Boolean = False) Dim Buffer() As Byte Dim Filenum As Integer If Dir(Filename) <> Empty Then 'Check if output file already exists If Overwrite Then Kill Filename Else Err.Raise 58 End If Buffer = LoadResData(ResID, ResType) 'Load the resource into a byte array Filenum = FreeFile Open Filename For Binary Access Write As Filenum Put Filenum, , Buffer 'Write the entire array into the file Close Filenum End Sub
Komentar Asli (3)
Dipulihkan dari Wayback Machine