Extracting file from the resource file
Hello. I have this problem. I need to put this picture to the resource file of my visual basic project and i want the picture be extracted to the computers hard disk to a folder colled c:\game. Is there anyway i can do this? I am sorry if the question is noob i just want to know. Thank you in advance!
Re: Extracting file from the resource file
Yes, there is... Do a search and you will find lots of examples.
Re: Extracting file from the resource file
If its a picture then..:
Code:
SavePicture loadrespicture(101,vbresbitmap), "C:\Picture.bmp"
Re: Extracting file from the resource file
Thanks! What kind of file types can be stored to the resource file?
Re: Extracting file from the resource file
What about the custom files. Like how do i extract a text from the resource files custom category like Hello.txt to c:\ drive. Thank you in advance!:wave:
Re: Extracting file from the resource file
Heres the function to extract form a custom resource.
Use it as follows:
ExtractSetup "C:\mytext.txt"
Code:
Private Sub ExtractSetup(ByVal Path As String)
On Error Resume Next
Dim resData() As Byte
resData = LoadResData(101, "CUSTOM")
Open Path For Binary Access Write As #1
Put #1, , resData
Close #1
End Sub
Re: Extracting file from the resource file
Quote:
Originally Posted by vb amateur
Thanks! What kind of file types can be stored to the resource file?
In the custom section? Anything and everything, because what gets put in there is simply raw data/bytes. Example already posted above shows how to extract the data.