PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook Program Addins ActiveInspector method returns wrong window when MS-Word is used as email editor

Reply

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

 
Thread Tools Rate Thread
Old 07-06-2004, 03:10 PM   #1
Dattatraya Shewale
Guest
 
Posts: n/a
Default ActiveInspector method returns wrong window when MS-Word is used as email editor


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
  Reply With Quote
Old 08-06-2004, 09:33 AM   #2
Matt Fletcher
Guest
 
Posts: n/a
Default Re: ActiveInspector method returns wrong window when MS-Word is used as email editor

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

"Dattatraya Shewale" <datta201@hotmail.com> wrote in message
news:18faa01c44c99$3fb91d20$a301280a@phx.gbl...
> 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



  Reply With Quote
Old 08-06-2004, 10:35 AM   #3
Dattatraya Shewale
Guest
 
Posts: n/a
Default Re: ActiveInspector method returns wrong window when MS-Word is used as email editor

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



>-----Original Message-----
>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
>
>"Dattatraya Shewale" <datta201@hotmail.com> wrote in

message
>news:18faa01c44c99$3fb91d20$a301280a@phx.gbl...
>> 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

>
>
>.
>

  Reply With Quote
Old 09-06-2004, 09:36 AM   #4
Dattatraya Shewale
Guest
 
Posts: n/a
Default Re: ActiveInspector method returns wrong window when MS-Word is used as email editor

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

Dattatraya
>-----Original Message-----
>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
>
>
>
>>-----Original Message-----
>>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
>>
>>"Dattatraya Shewale" <datta201@hotmail.com> wrote in

>message
>>news:18faa01c44c99$3fb91d20$a301280a@phx.gbl...
>>> 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

>>
>>
>>.
>>

>.
>

  Reply With Quote
Old 09-06-2004, 09:53 AM   #5
Matt Fletcher
Guest
 
Posts: n/a
Default Re: ActiveInspector method returns wrong window when MS-Word is used as email editor

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:eactivate (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

"Dattatraya Shewale" <datta201@hotmail.com> wrote in message
news:1989901c44d3b$f2da2b90$a501280a@phx.gbl...
> 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
>
>
>
> >-----Original Message-----
> >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
> >
> >"Dattatraya Shewale" <datta201@hotmail.com> wrote in

> message
> >news:18faa01c44c99$3fb91d20$a301280a@phx.gbl...
> >> 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

> >
> >
> >.
> >



  Reply With Quote
Old 09-06-2004, 05:08 PM   #6
Dattatraya Shewale
Guest
 
Posts: n/a
Default Re: ActiveInspector method returns wrong window when MS-Word is used as email editor

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

Thanks
Dattatraya


>-----Original Message-----
>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:eactivate (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
>
>"Dattatraya Shewale" <datta201@hotmail.com> wrote in

message
>news:1989901c44d3b$f2da2b90$a501280a@phx.gbl...
>> 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
>>
>>
>>
>> >-----Original Message-----
>> >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
>> >
>> >"Dattatraya Shewale" <datta201@hotmail.com> wrote in

>> message
>> >news:18faa01c44c99$3fb91d20$a301280a@phx.gbl...
>> >> 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
>> >
>> >
>> >.
>> >

>
>
>.
>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

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