none
Using IMAPIAdviseSink to monitor folder to folder copy operations RRS feed

  • Question

  • I need to monitor a folder A and detect when another folder B is copied to A. Then I need to read all the messages in the copied folder B. Putting an advise sink (fnevTableModified) on A's hierarchy table will notify me with a TABLE_ROW_ADDED when B is copied to A. That's all fine. The problem is that B's contents table does not immediately contain all its messages. It usually contains 0. If I put a sleep in for a few seconds before calling B's GetContentsTable, all messages are present. I could loop and sleep and wait for all the messages but I don't know how many messages are supposed to be there.

    Any ideas on how to solve the problem?

    Thursday, January 7, 2016 6:25 PM

Answers

  • Hello Chuck,

    Try to subscribe to the notifications to the B folder when you receive the first one (when B is copied to A). I believe you will get any and only then check out the content. 

    Thursday, January 7, 2016 8:01 PM

All replies

  • Hello Chuck,

    Try to subscribe to the notifications to the B folder when you receive the first one (when B is copied to A). I believe you will get any and only then check out the content. 

    Thursday, January 7, 2016 8:01 PM
  • Thanks. I tried that but it didn't work. Maybe a mistake. I'll retry.
    Thursday, January 7, 2016 8:07 PM
  • Hi Chuck,

    Have your issue been resolved from Eugene’s suggestion?

    >>I could loop and sleep and wait for all the messages but I don't know how many messages are supposed to be there
    To check whether all messages are there, I think you could loop, sleep and get the count of messages, if the count did not change, all messages are present.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, January 11, 2016 9:10 AM
  • There were several problems with my test code. Once I fixed them, creating advise sinks on new subfolder contents tables seems to work.
    Monday, January 11, 2016 10:46 PM