Results 1 to 4 of 4

Thread: Desperate need of help with resource files

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 1999
    Location
    Fridley, MN, USA
    Posts
    19

    Post

    I simply cant get to open a simple .exe or .txt file from a resource file, i tried, but i seem to be way off, can anybody give me a little help here?

  2. #2
    Guest

    Post

    Are you trying to open a txt file as text into a text box? Are you trying to run the exe file? What is the resource file? Sorry for all the questions, I may not have any idea of what you are looking for but I can't help if I don't understand

  3. #3
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    Sure! Here is a function I wrote for a similar post:
    Code:
    Public Sub RunResourceExe(pintResourceID As Integer)
        Dim bytArr() As Byte
        Dim intFFN As Integer
        Dim strPath As String
    
        bytArr = LoadResData(pintResourceID, "CUSTOM")
        strPath = App.Path & IIf(Right(App.Path, 1) = "\", "~tempexe.exe", "\~tempexe.exe")
        intFFN = FreeFile
        Open strPath For Binary As intFFN
        Put #intFFN, , bytArr
        Close #intFFN
        Shell strPath, vbNormalFocus
    End Sub
    Usage: RunResourceExe ResourceID
    Example: RunResourceExe 101

    Assuming that you have an ID 101 in the CUSTOM thread.

    ------------------

    Serge

    Software Developer
    Serge_Dymkov@vertexinc.com
    Access8484@aol.com
    ICQ#: 51055819


  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jan 1999
    Location
    Fridley, MN, USA
    Posts
    19

    Post

    the code works to run the .exe, but i cant get it to load a text. I was also hoping you could make some sense to the code since i know just a little about what it means. Thanks.

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