Results 1 to 7 of 7

Thread: Anyone know how?

  1. #1
    Guest

    Question

    Does anyone know how to add a file to a program? What I mean is, say if the user didn't have this sound file, how would I distibute it with the program without the P&D wizard? I thought about storing all the contents of the wave file in a textbox, and then writing it to the hard drive later, then playing it, but that would be to stupid.

    So if nobody understands, please say so and I will try to be more specific.

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Whatever you do, don't add it into a textbox, it removes all the chr(0)

    I havent used the P&D wizard cuz i have vb5, but can't you add your file into that.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Guest
    If you include the file in the P&D wizard, then the user can freely change the file to a different one. Say if I had "beep.wav", the user could either rename it, or change the sound to "meep.wav" or something. It must able to be done.

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Well, I don't think thats a problem. We have tons of files we can change name on our computer that belongs to other applications that will crash if you rename. That's users own problem if he gotta change it to meep.wav

    You can always include a search that search for this specific wav file whatever it has been renamed to, but i think thats a waste of time

    This is what I think youre trying to do: Protect the file from manipulation
    If you really want that noone goes and overwrite/record hes/her own scream into your beep.wav and then it plays in your app, you can encrypt that file so that it cant be played from outside neither been replaced by another file. Of couse it could but it wont work.

    If you're desperate having that file in your compiled exe, you can put it into a rtfbox, it wont remove the chr(0)
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5
    Guest
    The trouble is, the file has to be deleted after it is used. It isn't a beep.wav, but evillarf.wav. After the program has finished what it is doing it shows a laughing Jolly Roger.

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    You may integrate that into your exe, extract it and put it open so that no other app or user may modify or delete it (without unlocking your harddisk protection). Then after closing it, kill it
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  7. #7
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840
    That's right.

    If you send it out you can't guarentee it will be deleted before it's copied or whatever but you can arrange things so that it would take a pro to grab your wave file.

    When you say "the file has to be deleted after it is used" I assume you mean you don't want anyone to copy it.

    Encrypt it, (even simply by Xor'ing The bytes against a password, proper encrypting would be better but annoying to impliment) and hold the bytes in a file or append them onto the end of the exe file.

    Paul Dwyer
    Network Engineer
    Aussie In Tokyo

    Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)

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