Hi. We have a program that calls a long-running (SolidWorks) API function. After a while, we get an error dialog saying that "the COM server is busy...". We've done some research and have found that you can control this by using a bit of C++ code similar to:
COleMessageFilter *pFilter = AfxOleGetMessageFilter();
if(pFilter)
{
pFilter->SetMessagePendingDelay(60000);
pFilter = NULL;
}
Problem is, we're ignorant on the C++ front and want to use VB.NET. We dug around and it turns out AfxOleGetMessageFilter comes from some MFC library. So my question is: is there some way we can achieve this call from VB.NET w/o getting into MFC? Is AfxOleGetMessageFilter a wrapper around some other WIN32API call that we can just DECLARE and call ourselves? Are there alternatives we should be pursuing?
I have one answer that suggests I implement the .NET IMessageFilter interface, but since that interface has only one seemingly unrelated method I'm still stumped.