Re: Put Object Containing Object

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"Lorin" <Lorin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:62AD9EAE-82D6-4EA3-9487-3221E6C7E754@xxxxxxxxxxxxxxxx
Since Put will not allow putting Objects that contain objects, is there a way
to wrap this object with an object in something that Put will work with?

ignoring the fact that types are not objects in VB, this code works fine

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type uHeaderInfo
Caption As String
Rectangle As RECT
TextAlign As Long
End Type
Private uHdr() As uHeaderInfo

Sub Main()
ReDim uHdr(5)
uHdr(1).Rectangle.Top = 42
Open "c:\x" For Binary As #1
Put #1, , uHdr(1)
Close #1
Open "C:\x" For Binary As #1
Get #1, , uHdr(2)
Close #1
MsgBox uHdr(2).Rectangle.Top
End Sub

Maybe if you explain what actual error you are getting or what the problem is somebody can help.


.



Relevant Pages

  • Re: Put Object Containing Object
    ... Private Type RECT ... Bottom As Long ... Private Type uHeaderInfo ...
    (microsoft.public.vb.general.discussion)
  • Re: Put Object Containing Object
    ... Private Type RECT ... Bottom As Long ... Private Type uHeaderInfo ... Private uHdr() As uHeaderInfo ...
    (microsoft.public.vb.general.discussion)