home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 6_2008-2009.ISO / data / zips / SaLiLoG_-_2163539272009.psc / Server / PropBagCompile.bas < prev    next >
BASIC Source File  |  2009-09-26  |  1KB  |  43 lines

  1. Attribute VB_Name = "PropBagCompile"
  2. '                    SaLiLoG 1.0
  3. '                  By SaLar Zeynali
  4. '        Salixem@Gmail.Com - S4LiX3M@Yahoo.Com
  5. '  _________      .____    .______  ___        _____
  6. ' /   _____/____  |    |   |__\   \/  /____   /     \
  7. ' \_____  \\__  \ |    |   |  |\     // __ \ /  \ /  \
  8. ' /        \/ __ \|    |___|  |/     \  ___//    Y    \
  9. '/_______  (____  /_______ \__/___/\  \___  >____|__  /
  10. '        \/     \/        \/        \_/   \/        \/
  11.  
  12. Public Function LoadCompiledData(Optional FileofData As String = "appexe") As PropertyBag
  13. On Error GoTo Quit:
  14. If FileofData = "appexe" Then: FileofData = App.Path & "\" & App.EXEName & ".exe"
  15. Set LoadCompiledData = New PropertyBag
  16. Dim DataBeginPos As Long
  17. Dim varTemp As Variant
  18. Dim byteArr() As Byte
  19. Open FileofData For Binary As #1
  20. Get #1, LOF(1) - 3, DataBeginPos
  21. Seek #1, DataBeginPos
  22. Get #1, , varTemp
  23. byteArr = varTemp
  24. LoadCompiledData.Contents = byteArr
  25. Close #1
  26. LoadCompiledData.WriteProperty "error", "false"
  27. Exit Function
  28. Quit:
  29. Close #1
  30. LoadCompiledData.WriteProperty "error", "true"
  31. End Function
  32. Public Sub CompileData(StubFile As String, PropBag As PropertyBag)
  33. Dim DataBeginPos As Long
  34. Dim varTemp As Variant
  35. Open StubFile For Binary As #1
  36. DataBeginPos = LOF(1)
  37. varTemp = PropBag.Contents
  38. Seek #1, LOF(1)
  39. Put #1, , varTemp
  40. Put #1, , DataBeginPos
  41. Close #1
  42. End Sub
  43.