Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Registry & File Input / Output

Post new topic   Reply to topic
Binary file.......... HELP ME !
View previous topic :: View next topic  
Author Message
uwo
Newbie


Joined: 03 May 2004
Posts: 3

PostPosted: May 3rd, 2004 03:31 PM    Post subject: Binary file.......... HELP ME ! Reply with quote

I want to create THIS FILE(download attach and extract file for view file)
I wish to create this file every time when i push a button, if by mustache I delete it, when i push a button and the file created in automatic mode.

Thank's in advance

Excuse my english......!!!!!!!!!
Back to top
View user's profile Send private message
Gilad_r
Centurion


Joined: 03 Mar 2004
Posts: 156

PostPosted: May 3rd, 2004 04:50 PM    Post subject: Reply with quote

load it in a resource file and then:
[vb:1:59cbb966bb] Dim b() As Byte

b() = LoadResData(ID, TYPE) 'set ID and TYPE according to what you set when you put it in the resource file

Open "c:\new.upd" For Binary As #1
Put #1, , b
Close #1
[/vb:1:59cbb966bb]
or just don't delete it in the first place Wink


HTH
Gilad
_________________
"you should make amends with you" (Incubus)
Back to top
View user's profile Send private message
uwo
Newbie


Joined: 03 May 2004
Posts: 3

PostPosted: May 4th, 2004 01:11 AM    Post subject: Reply with quote

Thank you GILAD , but I am new in Visual Basic...i don't know what to put in ID and in TYPE please be more explicit if you may perhaps you'll do the lines yourself

THE FILE 'TEST.UPD' (whicw is atached upper) is used by another aplication and is rased by it after beeing used automaticaly I WOULD LIKE TO CREATE ANOTHER APLICATION WHICH TO CREATE (TO REPLACE) THE FILE RASED PREVIOUSLY
thank you very much Cry
Back to top
View user's profile Send private message
Gilad_r
Centurion


Joined: 03 Mar 2004
Posts: 156

PostPosted: May 4th, 2004 06:42 AM    Post subject: Reply with quote

do you know how to load a file to a RES file?
goto to the menu 'Add-Ins' --> 'Add-In manager...'
load the 'VB 6 Resource Editor', press OK.
goto to the menu 'Tools' --> 'Resource Editor'
press on 'Add Custom Resource...' (it's the one before the '?')
select the file you want to add as a resource
right-click on the newly added file and select 'Properties...'
now you can edit the resouce ID and TYPE (and also Language),
and these are the values you have to put in a code like the one above.

the function LoadResData loads the data from the appropriate resource file (which is now a part of your app) to a byte array.
after doing that you can create the new file by stating: (NewFileName is a string containing the full path to the new file)
[vb:1:8daaad94ff]FileNum = FreeFile
Open NewFileName For Bianry As FileNum[/vb:1:8daaad94ff]
then you put the data you want into the file using: (b is the name of the byte array you loaded the RES file to...)
[vb:1:8daaad94ff] Put FileNum, , b[/vb:1:8daaad94ff]
and close the file:
[vb:1:8daaad94ff]Close FileNum[/vb:1:8daaad94ff]
and that's it...


HTH
Gilad
_________________
"you should make amends with you" (Incubus)
Back to top
View user's profile Send private message
uwo
Newbie


Joined: 03 May 2004
Posts: 3

PostPosted: May 4th, 2004 01:00 PM    Post subject: Reply with quote

Thank you very, very much GILAD , It WORKS !!! =D =D =D
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Registry & File Input / Output All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic