Hi,
Im looking for some support/suggestions on transitioning my Open For Binary Access approach, to one that supports Unicode characters in path and filename.
One of the features in my app saves data plus a thumbnail in a binary file using the following code:
(To simplify the code, Ive left out the definition and population of the private types.)
Then, to read the data from the file, its using this code:
As part of making my app fully Unicode aware, I realized that the Open
For Binary Access function, doesnt support e.g. Thai or Russian characters in the filename or path if youre running e.g. an English Windows.
For other parts of the app Im using the ADODB Stream to load the full file in memory, and then process it line by line, but I have no idea how to deal with the Private Types and thumbnail blob in this case.
All suggestions are welcome and much appreciated!
Thanks,
Erwin
Im looking for some support/suggestions on transitioning my Open For Binary Access approach, to one that supports Unicode characters in path and filename.
One of the features in my app saves data plus a thumbnail in a binary file using the following code:
Code:
Dim PPB As New PropertyBag
Dim oStdPicture As stdPicture
Dim lFileNumber As Long
lFileNumber = FreeFile
Open sFullFileName For Binary Access Write As #lFileNumber
Put #lFileNumber, 1, MyPrivateType1
Set oStdPicture = frmMain.picCanvas.Image
PPB.WriteProperty ("Picture"), oStdPicture
Put #lFileNumber, , PPB.Contents
Put #lFileNumber, , MyPrivateType2
Close #lFileNumber
Then, to read the data from the file, its using this code:
Code:
Dim PPB As New PropertyBag
Dim oStdPicture As stdPicture
Dim lFileNumber As Long
lFileHandle = FreeFile
Open sPath & sFile For Binary Access Read As #lFileHandle
Get #lFileHandle, 1, MyPrivateType1
Get #lFileHandle, , varBlob
PPB.Contents = varBlob
Set oStdPicture = PPB.ReadProperty(("Picture"), Nothing)
Get #lFileHandle, , MyPrivateType2
Close #lFileNumber
For other parts of the app Im using the ADODB Stream to load the full file in memory, and then process it line by line, but I have no idea how to deal with the Private Types and thumbnail blob in this case.
All suggestions are welcome and much appreciated!
Thanks,
Erwin