|
-
Oct 6th, 2000, 05:32 PM
#1
Thread Starter
Lively Member
I notice that one can embed files into a VB project. My thought is to embed a couple of RichText (.RTF) files, and then use a RichTextBox control to open them. My question is this: How to I reverse this process? How do I convert the embedded .RTF file back to a regular file? Can I do this?
-Zero the Inestimable
-
Oct 6th, 2000, 06:29 PM
#2
Frenzied Member
Yeah its not that hard.
Use a res file and put the
files into the file using
custom data.
then run this sub to
extract the file.
Function GetResFile(Index as Integer)
Dim arr() As Byte
Dim Fn As Integer
Dim tempstr As String
tempstr = App.Path & "\~File.RTF"
arr() = LoadResData(Index, "CUSTOM")
Fn = FreeFile
Open tempstr For Binary As #Fn
Put #Fn, , arr
Close #Fn
'load file into Richtocbox here
Kill tempstr
end function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|