Skip to main content
gamedev.net
🔒 Locked

VB structured data types

Started by KalvinB Dec 3, 2001 at 5:09 PM 2 replies 350+ views
ragonastick
ragonastick
Unless I''m misinterpreting the question (quite likely ), then it works like this:


Type MyStruct
Blah1 As Integer
Blah2 As Long
Blah3(5) As Byte
Blah4 As String * 4
End Type

Function LoadStuff(Filename As String) As MyStruct
Dim Filenum As Long

Filenum = FreeFile
Open Filename For Binary As Filenum

Get Filenum, 1, LoadStuff

Close Filenum
End Function


A few things you have to watch out for are the dynamic types (variable length strings and dynamic arrays), when written, VB puts in short headers describing their size, so unless you write those same headers with C++, then you can''t use those types.

Trying is the first step towards failure.
Trying is the first step towards failure.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.