A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Outlook 2007: Problem with SinkEvents on first explorer



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 7th 06, 11:34 AM posted to microsoft.public.developer.outlook.addins,microsoft.public.outlook.program_addins,microsoft.public.platformsdk.mapi,microsoft.public.platformsdk.messaging
news.microsoft.com
external usenet poster
 
Posts: 1
Default Outlook 2007: Problem with SinkEvents on first explorer

Hi,

I'm having trouble sinking events on the initial Outlook explorer with the OL 2007 Beta.

I get an exception (access violation) on this queryinterface call in my explorer event handler when I try to sink events.

hr = m_pExplorer-QueryInterface(IID_IConnectionPointContainer, (void **)&pCPC);

m_pExplorer is an Outlook::_ExplorerPtr

Here's the code in context .....
void CExplorerHandler::SinkEvents()
{
HRESULT hr;

IConnectionPointContainer* pCPC;
hr = m_pExplorer-QueryInterface(IID_IConnectionPointContainer, (void **)&pCPC);
if (SUCCEEDED(hr))
{
hr = pCPC-FindConnectionPoint(__uuidof(Outlook::ExplorerEve nts), &m_pConnection);
if (SUCCEEDED(hr))
{
AddRef();

hr = m_pConnection-Advise(static_castIDispatch*(this), &m_dwCookie);
}

----- SNIP ----
Now this used to work just fine on OL2003 (and OLXP and OL2000) and also works on any additional explorers opened in Outlook 2007.

It just seems to be the 1st one that causes the problem.

Any ideas ? ....... A security issue ? A Microsoft bug ? Something about the timing of the Outlook startup has changed ?

Regards,

Scott Quinn


Ads
  #2  
Old June 7th 06, 05:51 PM posted to microsoft.public.developer.outlook.addins,microsoft.public.outlook.program_addins,microsoft.public.platformsdk.mapi,microsoft.public.platformsdk.messaging
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Outlook 2007: Problem with SinkEvents on first explorer

An obvious question: are you sure m_pExplorer is not NULL?
When do you make that call?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"news.microsoft.com" wrote in message
...
Hi,

I'm having trouble sinking events on the initial Outlook explorer with the
OL 2007 Beta.

I get an exception (access violation) on this queryinterface call in my
explorer event handler when I try to sink events.

hr = m_pExplorer-QueryInterface(IID_IConnectionPointContainer, (void
**)&pCPC);

m_pExplorer is an Outlook::_ExplorerPtr

Here's the code in context .....
void CExplorerHandler::SinkEvents()
{
HRESULT hr;

IConnectionPointContainer* pCPC;
hr = m_pExplorer-QueryInterface(IID_IConnectionPointContainer, (void
**)&pCPC);
if (SUCCEEDED(hr))
{
hr = pCPC-FindConnectionPoint(__uuidof(Outlook::ExplorerEve nts),
&m_pConnection);
if (SUCCEEDED(hr))
{
AddRef();

hr = m_pConnection-Advise(static_castIDispatch*(this),
&m_dwCookie);
}

----- SNIP ----
Now this used to work just fine on OL2003 (and OLXP and OL2000) and also
works on any additional explorers opened in Outlook 2007.

It just seems to be the 1st one that causes the problem.

Any ideas ? ....... A security issue ? A Microsoft bug ? Something about the
timing of the Outlook startup has changed ?

Regards,

Scott Quinn


  #3  
Old June 8th 06, 01:39 AM posted to microsoft.public.developer.outlook.addins,microsoft.public.outlook.program_addins,microsoft.public.platformsdk.mapi,microsoft.public.platformsdk.messaging
Scott Quinn
external usenet poster
 
Posts: 3
Default Outlook 2007: Problem with SinkEvents on first explorer

Hi Dmitry,

No .... the pointer is not NULL.

I get the pointer from the app by calling ActiveExplorer (and I get the same
pointer getting the first item from the explorers collection).

The call itself is initially made in raw_OnStartupComplete (while at the
same time I successfully sink events on the explorers and inspectors
collections).

The application continues to try sink events on the main explorer itself
later (called by a timer).... but still without any luck..

Scott

"Dmitry Streblechenko" wrote in message
...
An obvious question: are you sure m_pExplorer is not NULL?
When do you make that call?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"news.microsoft.com" wrote in message
...
Hi,

I'm having trouble sinking events on the initial Outlook explorer with the
OL 2007 Beta.

I get an exception (access violation) on this queryinterface all in my
explorer event handler when I try to sink events.

hr = m_pExplorer-QueryInterface(IID_IConnectionPointContainer, (void
**)&pCPC);

m_pExplorer is an Outlook::_ExplorerPtr

Here's the code in context .....
void CExplorerHandler::SinkEvents()
{
HRESULT hr;

IConnectionPointContainer* pCPC;
hr = m_pExplorer-QueryInterface(IID_IConnectionPointContainer, (void
**)&pCPC);
if (SUCCEEDED(hr))
{
hr = pCPC-FindConnectionPoint(__uuidof(Outlook::ExplorerEve nts),
&m_pConnection);
if (SUCCEEDED(hr))
{
AddRef();

hr = m_pConnection-Advise(static_castIDispatch*(this),
&m_dwCookie);
}

----- SNIP ----
Now this used to work just fine on OL2003 (and OLXP and OL2000) and also
works on any additional explorers opened in Outlook 2007.

It just seems to be the 1st one that causes the problem.

Any ideas ? ....... A security issue ? A Microsoft bug ? Something about

the
timing of the Outlook startup has changed ?

Regards,

Scott Quinn




  #4  
Old June 8th 06, 05:47 PM posted to microsoft.public.developer.outlook.addins,microsoft.public.outlook.program_addins,microsoft.public.platformsdk.mapi,microsoft.public.platformsdk.messaging
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Outlook 2007: Problem with SinkEvents on first explorer

Hmmm... Does QI fail for other interfaces, such as IDispatch or IOleWindow?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Scott Quinn" wrote in message
...
Hi Dmitry,

No .... the pointer is not NULL.

I get the pointer from the app by calling ActiveExplorer (and I get the
same
pointer getting the first item from the explorers collection).

The call itself is initially made in raw_OnStartupComplete (while at the
same time I successfully sink events on the explorers and inspectors
collections).

The application continues to try sink events on the main explorer itself
later (called by a timer).... but still without any luck..

Scott

"Dmitry Streblechenko" wrote in message
...
An obvious question: are you sure m_pExplorer is not NULL?
When do you make that call?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"news.microsoft.com" wrote in message
...
Hi,

I'm having trouble sinking events on the initial Outlook explorer with
the
OL 2007 Beta.

I get an exception (access violation) on this queryinterface all in my
explorer event handler when I try to sink events.

hr = m_pExplorer-QueryInterface(IID_IConnectionPointContainer, (void
**)&pCPC);

m_pExplorer is an Outlook::_ExplorerPtr

Here's the code in context .....
void CExplorerHandler::SinkEvents()
{
HRESULT hr;

IConnectionPointContainer* pCPC;
hr = m_pExplorer-QueryInterface(IID_IConnectionPointContainer, (void
**)&pCPC);
if (SUCCEEDED(hr))
{
hr = pCPC-FindConnectionPoint(__uuidof(Outlook::ExplorerEve nts),
&m_pConnection);
if (SUCCEEDED(hr))
{
AddRef();

hr = m_pConnection-Advise(static_castIDispatch*(this),
&m_dwCookie);
}

----- SNIP ----
Now this used to work just fine on OL2003 (and OLXP and OL2000) and also
works on any additional explorers opened in Outlook 2007.

It just seems to be the 1st one that causes the problem.

Any ideas ? ....... A security issue ? A Microsoft bug ? Something about

the
timing of the Outlook startup has changed ?

Regards,

Scott Quinn






  #5  
Old June 9th 06, 08:46 AM posted to microsoft.public.developer.outlook.addins,microsoft.public.outlook.program_addins,microsoft.public.platformsdk.mapi,microsoft.public.platformsdk.messaging
Scott Quinn
external usenet poster
 
Posts: 3
Default Outlook 2007: Problem with SinkEvents on first explorer

Good point Dmitry and yeah they were exception fodder too.

Anyway I have a solution.....

While the pointer from ActiveExplorer() appears to be a valid pointer and
some methods seem work (AddRef) for the most part it's stuffed.

If I get a pointer from the explorers collection all works fine.

So there may be a bug in OL2007 with the object model and ActiveExplorer()

Thanks,

Scott Quinn

"Dmitry Streblechenko" wrote in message
...
Hmmm... Does QI fail for other interfaces, such as IDispatch or

IOleWindow?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Scott Quinn" wrote in message
...
Hi Dmitry,

No .... the pointer is not NULL.

I get the pointer from the app by calling ActiveExplorer (and I get the
same
pointer getting the first item from the explorers collection).

The call itself is initially made in raw_OnStartupComplete (while at the
same time I successfully sink events on the explorers and inspectors
collections).

The application continues to try sink events on the main explorer itself
later (called by a timer).... but still without any luck..

Scott

"Dmitry Streblechenko" wrote in message
...
An obvious question: are you sure m_pExplorer is not NULL?
When do you make that call?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"news.microsoft.com" wrote in message
...
Hi,

I'm having trouble sinking events on the initial Outlook explorer with
the
OL 2007 Beta.

I get an exception (access violation) on this queryinterface all in my
explorer event handler when I try to sink events.

hr = m_pExplorer-QueryInterface(IID_IConnectionPointContainer,

(void
**)&pCPC);

m_pExplorer is an Outlook::_ExplorerPtr

Here's the code in context .....
void CExplorerHandler::SinkEvents()
{
HRESULT hr;

IConnectionPointContainer* pCPC;
hr = m_pExplorer-QueryInterface(IID_IConnectionPointContainer,

(void
**)&pCPC);
if (SUCCEEDED(hr))
{
hr =

pCPC-FindConnectionPoint(__uuidof(Outlook::ExplorerEve nts),
&m_pConnection);
if (SUCCEEDED(hr))
{
AddRef();

hr = m_pConnection-Advise(static_castIDispatch*(this),
&m_dwCookie);
}

----- SNIP ----
Now this used to work just fine on OL2003 (and OLXP and OL2000) and

also
works on any additional explorers opened in Outlook 2007.

It just seems to be the 1st one that causes the problem.

Any ideas ? ....... A security issue ? A Microsoft bug ? Something

about
the
timing of the Outlook startup has changed ?

Regards,

Scott Quinn








 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Outlook 2007 B2 - new messages not displaying body Chris Ericoli Outlook - General Queries 2 June 6th 06 08:44 PM
Outlook Newsgroup Reader Add-In Problem in 2007 Beta Dr Ken Brown-Gratchev Outlook - Installation 0 May 28th 06 07:39 PM
Outlook 2007 (Writing new mails problem) Anders Outlook - General Queries 0 May 27th 06 09:19 AM
Office 2007 Problem with outlook install Alan Thederahn Outlook - Installation 1 May 26th 06 02:41 AM
Enternet Explorer Browser Problem Pita Outlook Express 3 January 13th 06 10:34 PM


All times are GMT +1. The time now is 09:18 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.