Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: CrAz3D on February 03, 2005, 09:28 PM

Title: FileTime into a string
Post by: CrAz3D on February 03, 2005, 09:28 PM
I'm tyring to basically create a packet for bnet.  I want to add a FileTime into this packet. 

What I have right now keep forcing VisualBasic to crash.

GetSystemTime ST
SystemTimetoFileTime ST, FT
'& then I call InsertFILETIME & VB crashes...

Public Function InsertFILETIME(FT As FILETIME)
    Dim lReturn As String * 8
    Call CopyMemory(lReturn, FT, Len(FT))
    Buffer = Buffer & lReturn
End Function


If I comment out the CopyMemory portion of the code all runs fine but it doesn't insert the FileTime, any suggestions?
Title: Re: FileTime into a string
Post by: UserLoser. on February 03, 2005, 10:14 PM

Public Sub InsertType(t As Long)
    Dim CopyBuffer As String
    Dim Size As Long
   
    Size = Len(t)
    CopyBuffer = Space(Size)
   
    Call CopyMemory(ByVal CopyBuffer, ByVal t, Size)
   
    StoreBuffer = StoreBuffer & CopyBuffer
    Size = Size + Len(t)
End Sub



Call InsertType(VarPtr(FT))