Click here to Skip to main content
15,917,617 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralGetSystemMenu() doesn't contain Minimize/Maximize Pin
ohadp30-Nov-03 1:12
ohadp30-Nov-03 1:12 
GeneralRe: GetSystemMenu() doesn't contain Minimize/Maximize Pin
Michael Dunn30-Nov-03 8:56
sitebuilderMichael Dunn30-Nov-03 8:56 
GeneralRe: GetSystemMenu() doesn't contain Minimize/Maximize Pin
ohadp30-Nov-03 18:43
ohadp30-Nov-03 18:43 
GeneralSHGetPathFromIDList fails for the PIDL of the Recycle-Bin Pin
ohadp30-Nov-03 0:44
ohadp30-Nov-03 0:44 
GeneralRe: SHGetPathFromIDList fails for the PIDL of the Recycle-Bin Pin
Jörgen Sigvardsson30-Nov-03 11:51
Jörgen Sigvardsson30-Nov-03 11:51 
QuestionWSANO_DATA- WHAT does this mean? Pin
Stan the man30-Nov-03 0:20
Stan the man30-Nov-03 0:20 
Questionhow to create a shortcut to a dialup networking connection programmtically Pin
jetboy29-Nov-03 23:58
jetboy29-Nov-03 23:58 
GeneralProblems by catching outlook events Pin
derzellner29-Nov-03 23:52
derzellner29-Nov-03 23:52 
Hi,
I found this article about catching outlook events:
http://www.codeproject.com/internet/outlookxpevents.asp?target=NewMail%7Cevent#xx635951xx

With this code you can catch the event, when a new mail is in the inbox.
It works fine !
I would like to catch an events when a new contact is saved or when a new appointment was created.
Theres´s no way for me to do this !
The problem is, that the FindConnectionPoint returns an error for the ItemEvents ConnectionPoint.

This is my code, which is same as in the article but only changed to the ContactItem.

//In the dialog class

1. ItemEvents m_OutlookContact;
2. //Add an event handler for the Application object.
m_pAppEventListener = new CAppEventListener();
m_pAppEventListener->AddRef();
m_pAppEventListener->AttachToSource
( m_OutlookContact.m_lpDispatch );

//In the cpp class where the EventListener is defined

STDMETHODIMP CAppEventListener::AttachToSource
( IUnknown* pEventSource )
HRESULT hr = S_OK;

IConnectionPointContainer* pCPC = NULL;
hr = pEventSource->QueryInterface( IID_IConnectionPointContainer,
(void**)&pCPC );
if (SUCCEEDED(hr)){

hr = pCPC->FindConnectionPoint( IID_ItemEvents,&m_pConnectionPoint);
if (SUCCEEDED(hr)){

hr = m_pConnectionPoint->Advise( this, &m_dwConnection );
}
pCPC->Release();
}



return hr;

}

//In the header class of the event listener I defined the item events from
the outlook typ libraries (OLE/COM Object Viewer)
const IID IID_ItemEvents=
{0x0006303A,0x0000,0x0000,{0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}};

Why is &m_pConnectionPoint : 0x00000000 ?
Only when I change the IID_ItemEvents to the IID_ApplicationEvents, which is
{0x0006304E,0x0000,0x0000,{0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}}
the function returns OK.

Can someone help me please ?







Generalwsnprintf() method .h file needed .. Pin
derik_konark29-Nov-03 23:52
derik_konark29-Nov-03 23:52 
GeneralRe: wsnprintf() method .h file needed .. Pin
PJ Arends30-Nov-03 0:05
professionalPJ Arends30-Nov-03 0:05 
Generalwsnprintf() method __defined_.h_file Pin
derik_konark29-Nov-03 23:21
derik_konark29-Nov-03 23:21 
GeneralSimple databse problem Pin
Scozturk29-Nov-03 22:51
professionalScozturk29-Nov-03 22:51 
GeneralRe: Simple databse problem Pin
Gareth Johnson30-Nov-03 8:50
sussGareth Johnson30-Nov-03 8:50 
GeneralRSA cryptosystem Pin
swanss29-Nov-03 22:11
sussswanss29-Nov-03 22:11 
GeneralRe: RSA cryptosystem Pin
Jörgen Sigvardsson30-Nov-03 11:53
Jörgen Sigvardsson30-Nov-03 11:53 
GeneralHelp pop3 !!!!!!!!!!!!!!!!! Pin
BaldwinMartin29-Nov-03 19:58
BaldwinMartin29-Nov-03 19:58 
GeneralLinking the dialog and its class Pin
J.B.29-Nov-03 19:18
J.B.29-Nov-03 19:18 
GeneralRe: Linking the dialog and its class Pin
BaldwinMartin29-Nov-03 19:24
BaldwinMartin29-Nov-03 19:24 
GeneralRe: Linking the dialog and its class Pin
J.B.29-Nov-03 19:32
J.B.29-Nov-03 19:32 
GeneralRe: Linking the dialog and its class Pin
BaldwinMartin29-Nov-03 19:35
BaldwinMartin29-Nov-03 19:35 
GeneralRe: Linking the dialog and its class Pin
J.B.29-Nov-03 19:38
J.B.29-Nov-03 19:38 
GeneralRe: Linking the dialog and its class Pin
BaldwinMartin29-Nov-03 19:42
BaldwinMartin29-Nov-03 19:42 
GeneralRe: Linking the dialog and its class Pin
JWood29-Nov-03 19:46
JWood29-Nov-03 19:46 
GeneralRe: Linking the dialog and its class Pin
J.B.29-Nov-03 19:53
J.B.29-Nov-03 19:53 
GeneralAfxConnectionAdvice undeclared identifier Pin
Prakash Nadar29-Nov-03 18:26
Prakash Nadar29-Nov-03 18:26 

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.