Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Binary Resource Files


Reply
 
Thread Tools Display Modes
  #1  
Old 04-03-2002, 12:13 PM
Neodammer's Avatar
Neodammer Neodammer is offline
Centurion
 
Join Date: Oct 2001
Location: Tel-Aviv Israel
Posts: 128
Unhappy Binary Resource Files


I used to remember, but anybody know how I can take for example a .mp3 from a resource file and "Properly" create a file named "music.mp3" ? Here is my code and i know this won't work for many reasons

Open App.Path & "\music.mp3" For Output As #1
Print #1, LoadResData(101, "CUSTOM")

Close #1
Reply With Quote
  #2  
Old 04-03-2002, 12:29 PM
Neodammer's Avatar
Neodammer Neodammer is offline
Centurion
 
Join Date: Oct 2001
Location: Tel-Aviv Israel
Posts: 128
Cool Scratch

I figured it out using this...


Public Sub LoadDataIntoFile(DataName As Integer, FileName As String)
Dim myArray() As Byte
Dim myFile As Long
If Dir(FileName) = "" Then
myArray() = LoadResData(101, "CUSTOM")
myFile = FreeFile
Open FileName For Binary Access Write As #myFile
Put #myFile, , myArray
Close #myFile
End If
End Sub

Private Sub Form_Load()
LoadDataIntoFile 101, App.Path & "\music.mp3"
MediaPlayer1.Open App.Path & "\music.mp3"

End Sub

................


I do wonder though ...hmm you think I can use that function to pull out several mp3's out of resource ?
Reply With Quote
  #3  
Old 04-03-2002, 12:42 PM
Squirm's Avatar
Squirm Squirm is offline
Political Coder

Retired Moderator
* Guru *
 
Join Date: Mar 2001
Location: London, England
Posts: 8,037
Default

I believe so... however, I dont think it is advisable to make huge resource files. They are mainly designed for storing a few small graphics and other data needed by the program.
__________________
Search the forums | Use [vb][/vb] tags | Still IRCing
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->