Added: Aug 19, 2002
Snippet uploaded by: snippet
Written By: Unknown
Demo: Sorry, no demo
Storing / Retrieving Files from a Resource File
Highlight all by clicking in box
Public Function CreateFileFromResource(ByVal FilePath As String, _
ByVal ResID As Long, _
ByVal ResType As String) _
'This function returns False if LoadResData() fails (unlikely)
'It also does not check to see whether FilePath already exists
'or do much error checking of any kind for that matter :-)
Dm hFile As Long
Dim FileData() As Byte
FileData = LoadResData(ResID, ResType) 'this loads your binary data
On Error Resume Next 'stuck this here just so the prog won't
'crash if something goes wrong with LoadResData()
If Len(FileData(1)) > 0 Then
hFile = FreeFile()
Open FilePath For Binary Access Write As #hFile
Put #hFile, 1, FileData 'this writes your binary data
CreateFileFromResource = True
No Comments to show
Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.
Adding your comment. Please wait...
Thanks for adding your comment!. After further review it will be added.
There was a problem adding your comment. Please try again.
Please complete all the fields in the form before sending.