VB6 - Programing with Resources Editor.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nmixer
    New Member
    • Mar 2006
    • 4

    VB6 - Programing with Resources Editor.

    If there is anyone with lots of experience in programming with the program you may be able to answer my question :P


    Alright, I'm creating a program, and using Custom Resources to make my .exe file and not have all my source files (for example .swf, or image or courses) in the main folder. There actually in the .exe when it is created.

    The program when it is run, well Create the file needed to run (for my its the .swf) inside the folder that the .exe is in.

    With this code:

    Code:
    Private Sub Form_Load()
        LoadDataIntoFile 101, App.Path & "\flash.swf"
        swFlashl.Movie = App.Path & "\flash.swf"
    End Sub
    
    
    Public Sub LoadDataIntoFile(DataName As Integer, FileName As String)
        Dim myArray() As Byte
        Dim myFile As Long
        If Dir(FileName) = "" Then
            myArray = LoadResData(101, "FLASH")
            myFile = FreeFile
            Open FileName For Binary Access Write As #myFile
            Put #myFile, , myArray
            Close #myFile
        End If
    End Sub
    This works perfectly.

    What I’m trying to do is either make the file Hidden on Creation, And Put the File Back into the Resource so once the .exe is closed the file is inaccessible.

    (If your wondering what I’m talking about when I’m saying Resources Editor, you can access it by doing the following: Go the Menu Item called Add-Ins > Add in Manager : Then look for this “VB 6 Resource Editor” and check Loaded/Unloaded and press ok.
    (if you want more info PM me, and I’ll help you out…)

    Anyways that’s what I’m looking for, how to ‘reload’ data into the Resource area.

    My reason is that the flash saves data in itself, and if I can reload the flash into the exe at the end of the exe then it makes for cleaner programming’’ and the source files are always going to be hidden.

    (Plus this could benefit if you do an options Form, you can save the values in a txt file and then have the txt file reloaded into your program when it is done (or you click ok))

    Anyways any help is greatly appreciated. :)
  • Nmixer
    New Member
    • Mar 2006
    • 4

    #2
    daily bump

    Comment

    • Banfa
      Recognized Expert Expert
      • Feb 2006
      • 9067

      #3
      Originally posted by Nmixer
      My reason is that the flash saves data in itself, and if I can reload the flash into the exe at the end of the exe then it makes for cleaner programming’’ and the source files are always going to be hidden.
      To do this you would actually be modifying the executable file itself. This is impossible because while executing an executable is locked (which you can easily test for you self by running a program and while it is running trying to delete it, you wont be able to) and you can not write to the file.

      Resourses are really for carrying data that is static and never going to change like splash screen bitmaps, dialogue box layouts, menu and button text, not the data files for a program.

      If you are really worried about other people accessing the data files for your program and stealing the data then encrypt them.

      Comment

      • Nmixer
        New Member
        • Mar 2006
        • 4

        #4
        That makes sence. Thank you, now i can move on :p


        Originally posted by Banfa
        To do this you would actually be modifying the executable file itself. This is impossible because while executing an executable is locked (which you can easily test for you self by running a program and while it is running trying to delete it, you wont be able to) and you can not write to the file.

        Resourses are really for carrying data that is static and never going to change like splash screen bitmaps, dialogue box layouts, menu and button text, not the data files for a program.

        If you are really worried about other people accessing the data files for your program and stealing the data then encrypt them.

        Comment

        Working...