none
IOleMessageFilter makes some problems in normal methods RRS feed

  • Question

  • Hi Guys

    Hope you are fine.

    I have a Visio add-in. Recently I implemented MessageFilter base on IOleMessageFilter to avoid "Call was rejected by callee" (RPC_E_CALL_REJECTED).

    My implementation is similar to http://msdn.microsoft.com/en-us/library/ms228772.aspx

    everything works fine BUT some of my normal functions doesn't work when I use MessageFilter!!!!!

    For example when I wanted to set the Dock of the window that is in the Microsoft.Office.Interop.Visio.Window it doesn't work!!!

    I checked the messages carefully but none of the messages Rejected or Canceled !!!

    PS: I used PENDINGMSG_WAITDEFPROCESS for all MessagePending and SERVERCALL_ISHANDLED for all HandleInComingCall.

    I would appreciate if you could help me.

    Thank you......

    Tuesday, September 9, 2014 1:37 PM

Answers

  • Hi

    Thank you for your message.

    During creating a small sample I find out that the problem is using BackgroundWorker in Visio-addin with Message Filter.

    I'm reading different posts about this like:

    like this

    and this

    It means that I shouldn't use BackgroundWorker in office add-in ?

    Thanks a lot
    Danesh
    Friday, September 19, 2014 9:05 PM

All replies

  • Hello Daneshk,

    Why do you need to use the IOleMessageFilter? What code exactly causes the issue?

    Tuesday, September 9, 2014 2:38 PM
  • Hi

    As you know when Visio (or any other office program or VS) is busy to answer add-in messages it raises "Call was rejected by callee" (RPC_E_CALL_REJECTED).

    So I wanted to implement IOleMessageFilter, so add-in retries till Visio become free.

    But specific methods does not work when I use IOleMessageFilter.

    It seems that MessageFilter filters some normal messages (calls) between Visio and Add-in.

    Thanks


    Tuesday, September 9, 2014 3:08 PM
  • >>But specific methods does not work when I use IOleMessageFilter.<<

    Which methods does not work? Could you share some code?

    Monday, September 15, 2014 7:40 AM
  • Thank you for your response.

    for example I add a windows form to the bottom of Visio and set the DockStyle:

     displayForm.Dock = System.Windows.Forms.DockStyle.Fill;

    and it works properly like image below.

    Befor Message Filter

    but after using Message Filter Docking of this windows does not work (Like this image)

    After Message Filter

    Monday, September 15, 2014 1:59 PM
  • Hi Daneshk,

    As chunchencool pointed please let us know which methods do not work and under what circumstance they are invoked?

    Also test if you are able to reproduce the issue on different machine or issue is specific to some set of machines.

    Regards,

    Monday, September 15, 2014 7:05 PM
  • Hi Daneshk,

    Please let us know if the issue is resolved.

    Regards,

    Thursday, September 18, 2014 10:53 PM
  • Hi

    Thank you for your message.

    During creating a small sample I find out that the problem is using BackgroundWorker in Visio-addin with Message Filter.

    I'm reading different posts about this like:

    like this

    and this

    It means that I shouldn't use BackgroundWorker in office add-in ?

    Thanks a lot
    Danesh
    Friday, September 19, 2014 9:05 PM