I am trying to copy a repeat appointment which contain 1 parent note and 1 child note using C API.
I was able to copy the content of the parent and child note (using the sample code from CAPI).
However, I was not able to “fixup” the parent-child relationship via _NOTE_RESPONSE_COUNT, $REF, _NOTE_PARENT_NOTEID etc. even though I called NSFNoteSetInfo successfully for those item. In fact most of these call doesn’t affect the new copy of the note.
It there something special I need to change in the new child (& parent) to make a perfect new copy of the recurring appt?
=====
code:
copyRecurringNote()
{
NOTEHANDLE hParent = ...
NOTEHANDLE hChild = ...
copySingleNote(hParent);
copySingleNote(hChild);
// call NSFNoteSetInfo to fixup the _NOTE_RESPONSE_COUNT, $REF, _NOTE_PARENT_NOTEID
...; // doesn't change a thing to hParent & hChild?!?!
}
copySingleNote(NOTEHANDLE hTargetNote)
{
// similar to what the sample does, skip error checking code...
NSFNoteCopy(hTargetNote, &hNote);
NSFDbGenerateOID(hDB, oid);
NSFNoteSetInfo(hNote, _NOTE_OID, &oid);
NSFNoteSetInfo(hNote, _NOTE_ID, NULL);
NSFNoteSetInfo(hNote, _NOTE_DB, &hDB);
NSFNoteUpdate(hNote, UPDATE_FORCE);
NSFNoteGetInfo)(hNote, _NOTE_ID, &nid);
...
}
Arnold