Error 1816 when calling PostMessage after using OLE message filter and VB .NET call to Process.Start

  • Thread starter Thread starter RD Holland
  • Start date Start date
R

RD Holland

Guest
This is a tough one for me. Our c++ MFC COM app uses the MFC OLE message filter. I have a VB add-in (running in-proc) that needs to kick off a process when one of its commands runs. I have a sample that just starts notepad using

Dim proc as Process

theApp.SetOleRequestPendingTimeout(10000000)

proc = System.Diagnostics.Process.Start("notepad")

proc.WaitForExit()

theApp.SetOleRequestPendingTimeout()


The second call to set the pending timeout results in our code setting the OLE message filter timeout back to the default (8 seconds).

Here is the problem. If the user waits about 5 minutes to close the process, our app doesn't run correctly. I have traced the problem down to message posting. For some period of time after the process exits and the command exits and processing returns to our application, all our calls to PostMessage result in PostMessage returning zero. GetLastError() shows the error is 1816. ErrorLookup (from Visual Studio tools) gives this message: "Not enough quota is available to process this command"

I don't think our app has been ghosted as task manager doesn't indicate the app isn't responding (the OLE message filter is executing and various threads still get CPU time). This has me perplexed as I am familiar with the COleMessageFilter MFC provides and setting the pending timeout simply sets a member variable that is used when the filter processes messages. Once set back to the default, messages are processed. The only issue I have found is with PostMessage, and eventually calls to PostMessage return 1 and the target of the message actually receives the message.

If the user only waits, say a minute or two before closing the process started, there is no issue at all. Anyone have a clue as to why preventing a server busy dialog via the server busy timeout would cause an issue if our process waits for 5 minutes or more for the started process to end?

I want my quota back in a timely fashion! OS is Win10 as reported by the ISV. I tested on my Win10 box and easily duplicated it.




R.D. Holland

Continue reading...
 
Back
Top