Hi guys
I want to call all the files outside the program and in a single file (external resource file)
I did this with the help of PBag Resources but it doesn't read all the files
Text files and images are called, but there is a problem with other files
For example, it cannot read the file to install the font
It gives an error that the data value named "MyFont.ttf" was not found
How can I call all the files?
I want to call all the files outside the program and in a single file (external resource file)
I did this with the help of PBag Resources but it doesn't read all the files
Text files and images are called, but there is a problem with other files
For example, it cannot read the file to install the font
HTML Code:
Option Explicit
Private Declare Function AddFontResourceEx Lib "gdi32" Alias "AddFontResourceExA" _
(ByVal sFIleName As String, ByVal lFlags As Long, ByVal lReserved As Long) As Long
Private Const FR_PRIVATE As Long = &H10
Public Function InstallFont(pFontPath As String) As Long
InstallFont = AddFontResourceEx(pFontPath, FR_PRIVATE, 0&)
End Function
Private Sub Form_Load()
Dim BagFile As Integer
Dim ContentBytes() As Byte
BagFile = FreeFile(0)
Open "bag.dat" For Binary Access Read As #BagFile
ReDim ContentBytes(LOF(BagFile) - 1)
Get #BagFile, , ContentBytes
Close #BagFile
With New PropertyBag
.Contents = ContentBytes
lblBurger.Caption = .ReadProperty("Burger.txt")
lblFries.Caption = .ReadProperty("Fries.txt")
InstallFont (.ReadProperty("MyFont.ttf"))
End With
Text1.Font.Name = "MyFont"
End Sub
How can I call all the files?