VC++ sample for fast notification interface? - WeOnlyDo Discussion board

VC++ sample for fast notification interface? (wodSmtp)

by Paul, Monday, October 10, 2005, 21:56 (6829 days ago)

I'm wanting to use wodSMTP (COM component) asynchronously in a worker thread (no message loop). I need the async model so that I can abort a long send if necessary.

In this situation, the event approach doesn't work (due to lack of message loop), so I'm guessing that the notification interface is required?

If so, are there any VC++ samples covering use of this inteface?

Re: VC++ sample for fast notification interface?

by wodSupport, Monday, October 10, 2005, 22:00 (6829 days ago) @ Paul

Paul,

if events don't work then notification interface doesn't work also - it's the same thing just different calling specification.

Re: VC++ sample for fast notification interface?

by Paul, Monday, October 10, 2005, 22:26 (6829 days ago) @ wodSupport

Thanks for a very fast reply!

OK... as an alternative solution I tried just pumping some messages in the worker thread while waiting for the async send to complete, and this seemed to work OK. I'll test this approach for a bit and see if there are any drawbacks...

Re: VC++ sample for fast notification interface?

by wodSupport, Monday, October 10, 2005, 22:29 (6829 days ago) @ Paul

Paul,

no drawbacks, that's how I think you should do it. Just make sure you use WaitMessage so you don't use CPU too much, and make sure you can always get out of the loop (you can use WM_TIMER to be posted regularly for that).

Kreso

Re: VC++ sample for fast notification interface?

by Paul, Monday, October 10, 2005, 23:44 (6829 days ago) @ wodSupport

That's great - thanks a lot!