Click here to Skip to main content
15,888,454 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Selecting an item in listview via windows api. Pin
svsundar (Vairavan)31-Aug-06 2:56
svsundar (Vairavan)31-Aug-06 2:56 
GeneralRe: Selecting an item in listview via windows api. Pin
Michael Dunn31-Aug-06 18:48
sitebuilderMichael Dunn31-Aug-06 18:48 
QuestionCEdit Woes Pin
HakunaMatada30-Aug-06 2:14
HakunaMatada30-Aug-06 2:14 
AnswerRe: CEdit Woes Pin
prasad_som31-Aug-06 3:56
prasad_som31-Aug-06 3:56 
Questionhow to proceed with Notification of emails using Mapi. Pin
uday kiran janaswamy29-Aug-06 23:28
uday kiran janaswamy29-Aug-06 23:28 
AnswerRe: how to proceed with Notification of emails using Mapi. Pin
Steve S30-Aug-06 0:31
Steve S30-Aug-06 0:31 
GeneralRe: how to proceed with Notification of emails using Mapi. Pin
uday kiran janaswamy30-Aug-06 2:05
uday kiran janaswamy30-Aug-06 2:05 
GeneralRe: how to proceed with Notification of emails using Mapi. Pin
Steve S30-Aug-06 7:14
Steve S30-Aug-06 7:14 
Hmm. You've obviously not done anything like this before.

A sink object is the term for an object that implements a specific interface.
Let's say your interface is IMySink.

Somewhere you have a definition for this.

In C++, you can say that a class of objects derives from a number of base classes, leaving aside the 'diamond' problem of multiple inheritance.

So you can say

class CMyClass : public Someclass, public IMySink
{
...
};

You provide implementation for each of the methods in IMySink, and any classes that it inherits from (such as IDispatch or IUnknown). Many of these can simply return S_OK, or even E_NOTIMPL, since you may not need them to actually do anything.

You then need to get the interface in your app, and connect it to the COM object that's providing the notifications.

Say you have

CMyClass myObj;
then

IMySink* pSink = static_cast<IMySink>( &myObj );

will do the first bit, and you then need to pass that interface to the other side. There will be an Advise( ) method or similar, for example, the IMAPISession interface implements this, and one of it's parameters is an advise sink pointer. That's you, that is...

When you're done, you will need to de-register by calling Unadvise() or whatever the equivalent is.

Now for the fun bit; when the MAPI session object wants to tell you that something has happened, it will call the appropriate function of your interface. If you are being a good COM citizen, you won't do much direct processing in the function, maybe copy some parameters and post yourself a message or something. Why? Because the MAPI object can't continue until your function returns, and you really don't want to hold things up unless you really have to...

Enjoy.

Steve S
Developer for hire

QuestionHow I can get listview subitem text of a listview on another process? Pin
Marco225028-Aug-06 9:05
Marco225028-Aug-06 9:05 
QuestionGet Parent handle in ATL Windowless Control Pin
QuickDeveloper27-Aug-06 22:50
QuickDeveloper27-Aug-06 22:50 
AnswerRe: Get Parent handle in ATL Windowless Control Pin
Roland Rüdenauer17-Sep-06 12:02
Roland Rüdenauer17-Sep-06 12:02 
Questionowner draw CReBarCtrl [modified] Pin
Max Santos26-Aug-06 6:22
Max Santos26-Aug-06 6:22 
AnswerRe: owner draw CReBarCtrl Pin
Justin Tay26-Aug-06 15:58
Justin Tay26-Aug-06 15:58 
AnswerRe: owner draw CReBarCtrl Pin
count08-Sep-06 17:50
count08-Sep-06 17:50 
Questionvector vs. CByteArray [modified] Pin
bob1697225-Aug-06 4:06
bob1697225-Aug-06 4:06 
AnswerRe: vector vs. CByteArray Pin
Stuart Dootson25-Aug-06 5:33
professionalStuart Dootson25-Aug-06 5:33 
GeneralRe: vector vs. CByteArray Pin
bob1697225-Aug-06 5:55
bob1697225-Aug-06 5:55 
GeneralRe: vector vs. CByteArray Pin
Zac Howland25-Aug-06 7:48
Zac Howland25-Aug-06 7:48 
GeneralRe: vector vs. CByteArray Pin
Stuart Dootson28-Aug-06 21:13
professionalStuart Dootson28-Aug-06 21:13 
GeneralRe: vector vs. CByteArray Pin
Zac Howland29-Aug-06 4:26
Zac Howland29-Aug-06 4:26 
GeneralRe: vector vs. CByteArray Pin
Jörgen Sigvardsson30-Aug-06 21:25
Jörgen Sigvardsson30-Aug-06 21:25 
QuestionHow to use WTL's CDoubleBufferImpl Pin
shaohao25-Aug-06 4:04
shaohao25-Aug-06 4:04 
AnswerRe: How to use WTL's CDoubleBufferImpl Pin
Stuart Dootson25-Aug-06 5:34
professionalStuart Dootson25-Aug-06 5:34 
AnswerRe: How to use WTL's CDoubleBufferImpl Pin
Michael Dunn25-Aug-06 7:39
sitebuilderMichael Dunn25-Aug-06 7:39 
QuestionCalling a ATL COM DLL interface from VBScript routine Pin
AKSIVAKUMAR23-Aug-06 23:11
AKSIVAKUMAR23-Aug-06 23:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.