Results 1 to 7 of 7

Thread: Extracting file from the resource file

Hybrid View

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2007
    Posts
    15

    Lightbulb 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!

  2. #2
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Extracting file from the resource file

    Yes, there is... Do a search and you will find lots of examples.

  3. #3
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    Re: Extracting file from the resource file

    If its a picture then..:

    Code:
    SavePicture loadrespicture(101,vbresbitmap), "C:\Picture.bmp"
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2007
    Posts
    15

    Re: Extracting file from the resource file

    Thanks! What kind of file types can be stored to the resource file?

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2007
    Posts
    15

    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!

  6. #6
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    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
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  7. #7
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width