Hi friends i need your help, please! im trying to lock and unlock multiple directories (folders) (im creating a folder lock), I can block many folders but only unlock one, when trying to unlock another one vb6 tells me: err 75. I understand that this happens because it's saving or creating the file in only one registry location and need store in a Collection list, but i dont know how (i have no idea). I use this code:

Code Code:
  1. Private Const FILE_LIST_DIRECTORY = &H1
  2. Private Const FILE_SHARE_READ = &H1&
  3. Private Const FILE_SHARE_DELETE = &H4&
  4. Private Const OPEN_EXISTING = 3
  5. Private Const FILE_FLAG_BACKUP_SEMANTICS = &H2000000
  6. Private Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, ByVal PassZero As Long, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal PassZero As Long) As Long
  7. Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
  8.  
  9. Dim File_Share_Flag As Long
  10. Dim hDir As Long
  11.  
  12.  
  13. Private Sub mnublock_Click()
  14.  
  15. 'Block code
  16.             Dim PathDir As String
  17.     PathDir = itemData + Ext
  18.     hDir = CreateFile(PathDir, FILE_LIST_DIRECTORY, File_Share_Flag, _
  19.                       ByVal 0&, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, ByVal 0&)
  20.  
  21. End Sub
  22.            
  23.  
  24. Private Sub mnuUnblock_Click()
  25. 'Unblock code
  26. CloseHandle hDir
  27. End Sub

* Note: itemData read a .ini file, the .ini values are set in a Listbox, some like this:

code2 Code:
  1. itemData = ReadINI("My files protected", "File" & CStr(Counter), iniPath & "data.ini")


The problem is when try unlock all the previous locked folders, only one can be unlocked
thanks a lot for the help And sorry for my poor English