Invisionsoft
Well-known member
My friend sent me a VB6 app which dumps JPEG files into a single file. It successfully upgraded, but it doesn't work. I believe the major problem is converting the old functions to System.IO or the My namespace, but I haven't found much info on doing that.
Here are the interesting bits of the code:
Includes, video header structure
The following code errors when dumping the structure header into the file:
And the following code errors when dumping the current frame into the file:
Can you help me?
Here are the interesting bits of the code:
Includes, video header structure
VB.NET:
Public fh As Integer
Public framefh As Integer
Public outquality As Integer
Public result As String
Public framecount
Structure VIDEO_HEADER
Dim magic As String
Dim framecount As Long
Dim samplesize As Integer
Dim finalsample As Integer
Dim frametype As Integer
Dim reserved As String
End Structure
The following code errors when dumping the structure header into the file:
VB.NET:
fh = FreeFile()
FileOpen(fh, path + "outfile.emc", OpenMode.Binary)
Dim vidhead As New VIDEO_HEADER
vidhead.magic = "EMC01000"
vidhead.framecount = framecount
vidhead.frametype = 0
vidhead.samplesize = 0
vidhead.finalsample = 0
FilePutObject(fh, vidhead)
And the following code errors when dumping the current frame into the file:
VB.NET:
For i = 1 To framecount
framefh = FreeFile()
FileOpen(framefh, path + "framedump\" & i.ToString & ".jpg", OpenMode.Binary)
Dim iFrameSize As Integer = LOF(framefh)
FilePutObject(fh, iFrameSize)
Dim inbuffer As String = Space(iFrameSize)
FileGetObject(framefh, inbuffer)
FileClose(framefh)
FilePutObject(fh, inbuffer)
Next
Can you help me?