471,066 Members | 1,633 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

VB6 - Programing with Resources Editor.

4
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:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.     LoadDataIntoFile 101, App.Path & "\flash.swf"
  3.     swFlashl.Movie = App.Path & "\flash.swf"
  4. End Sub
  5.  
  6.  
  7. Public Sub LoadDataIntoFile(DataName As Integer, FileName As String)
  8.     Dim myArray() As Byte
  9.     Dim myFile As Long
  10.     If Dir(FileName) = "" Then
  11.         myArray = LoadResData(101, "FLASH")
  12.         myFile = FreeFile
  13.         Open FileName For Binary Access Write As #myFile
  14.         Put #myFile, , myArray
  15.         Close #myFile
  16.     End If
  17. End Sub
  18.  
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. :)
Mar 25 '06 #1
3 5516
Nmixer
4
daily bump
Mar 26 '06 #2
Banfa
9,065 Expert Mod 8TB
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.
Mar 26 '06 #3
Nmixer
4
That makes sence. Thank you, now i can move on :p


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.
Mar 26 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

12 posts views Thread by Stephen Tyndall | last post: by
13 posts views Thread by Xah Lee | last post: by
12 posts views Thread by Xah Lee | last post: by
reply views Thread by Aleksey Tkachenko | last post: by
4 posts views Thread by David | last post: by
6 posts views Thread by GAZ | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.