Subject: RE: synchronize read/unread marks between user and delegate user
Well, I expected this question; here is some sample code which I extracted from a larger function, so it could be that there is a small error in it. If you have a look at the reference db that comes with the C API SDK, you will find ample explications.
[declarations]
Declare Function NSFDbClose Lib “nnotes.dll” (Byval hDb As Long) As Integer
Declare Function NSFDbGetUnreadNoteTable Lib “nnotes.dll” (Byval hDb As Long, Byval UserName As String, Byval NameLength As Integer, Byval Create As Integer, hUnreadTable As Long) As Integer
Declare Function NSFDbOpen Lib “nnotes.dll” (Byval dbName As String, hDb As Long) As Integer
Declare Function NSFDbSetUnreadNoteTable Lib “nnotes.dll” (Byval hDb As Long, Byval UserName As String, Byval NameLength As Integer, Byval Flush As Integer, Byval hOriginalTable As Integer, Byval hUnreadTable As Long) As Integer
Declare Function NSFDbUpdateUnread Lib “nnotes.dll” (Byval hDb As Long, Byval hTable As Long) As Integer
Declare Function IDTableIntersect Lib “nnotes.dll” (Byval hTable1 As Long, Byval hTable2 As Long, hTable As Long) As Integer
Declare Function OSPathNetConstruct Lib “nnotes.dll” (Byval portname As String, Byval servername As String, Byval filename As String, Byval pathname As String) As Integer
Declare Function NSFNoteUpdate Lib “nnotes.dll” (Byval hNote As Long, Byval UpdateFlags As Integer) As Integer
[code]
Dim dbp As String*256
Dim dbpath As String
Dim status As Integer
Dim ownerlist As Long
Dim delegatelist As Long
Dim combinedlist As Long
Dim hDB as Long
status = OSPathNetConstruct(Null, , , dbp)
dbpath = Trim$(dbp)
status = NSFDbOpen(dbpath, hdb)
status = NSFDbGetUnreadNoteTable(hDB, , Len(), True, ownerlist)
status = NSFDbUpdateUnread(hDB, ownerlist)
status = NSFDbGetUnreadNoteTable(hDB, , Len(), True, delegatelist)
status = NSFDbUpdateUnread(hDB, delegatelist)
status = IDTableIntersect(ownerlist, delegatelist, combinedlist)
status = NSFDbSetUnreadNoteTable(hDB, < delegatename >, Len(), True, delegatelist, combinedlist)
IDDestroyTable(ownerlist)
IDDestroyTable(delegatelist)
IDDestroyTable(combinedlist)
status = NSFDbClose(hDB)