ActiveInspector method returns wrong window when MS-Word is used as email editor

  • Thread starter Dattatraya Shewale
  • Start date
D

Dattatraya Shewale

Hi All,
I am developing a Outlook add-in through c#.Currently I
am facing problem with the ActiveInspector() method. When
user opens multiple windows in Outlook and use MS-Word as
an Email editor, then the Window returned by this method
is wrong one. Can anybody help me out of this, please?

Thanks
Dattatraya
 
M

Matt Fletcher

I hit this problem too with Outlook XP. My solution is to maintain a flag in
my inspector handler which is set/unset when handling activate/deactivate
events - I maintain an array of inspector handlers in my inspectors handler
and loop through them asking whether they are active.

I am sure there are more sophisticated ways to solve the problem, but this
works.

Matt Fletcher
 
D

Dattatraya Shewale

Hi Matt
Thanks for the reply. I have some queries
regarding your solution.
1)Are you talking about writing wrapper class for
Inspector and maintain a flag in that class?
2)On activate/deactivate events we doesn't get the
reference of the Inspector which is activated/deactivated,
so where should I set the flag?
Can you elaborate further, please? Any code snippet
describing your solution will be appreciated.

Thanks once again
Dattatraya Shewale
 
D

Dattatraya Shewale

Hi Matt
Thanks for your solution, I got your point. Thanks one
again

Dattatraya
 
M

Matt Fletcher

1. Yes, we have both a wrapper class (CMailHandler) that wraps an Inspector
object and handles Inspector events, and a separate wrapper class
(CInspectorsHandler) that handles Inspectors events (i.e. New Inspector).
CInspectorsHandler maintains an array of CMailHandlers corresponding to the
Inspectors collection. CMailHandler contains a flag which records whether it
is active, and a method to allow public access to the value of this flag.
2. CMailHandler handles InspectorEvents::Activate (0xf001) and
InspectorEvents::Deactivate (0xf006), setting and unsetting the flag as
appropriate - as this event is handled by the instance of the wrapper class
wrapping the particular Inspector, there is no need for a reference to the
Inspector object.

Unfortunately this code is embedded in a fairly substantial application and
I don't have time to extract code snippets - and I'm working in C++ rather
than C# anyway.

HTH
Matt Fletcher
 
D

Dattatraya Shewale

Hi Matt,
Thanks for your reply. The problem is solved with your
solution.

Thanks
Dattatraya
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top