During programming, you will always encounter a popup dialog box titled Server Busy, especially if you add COM components to your program. The following lines of code can be easily resolved.
afxolegetmessagefilter ()->enablebusydialog (FALSE);
afxolegetmessagefilter ()->setbusyreply (servercall_retrylater);
afxolegetmessagefilter ()->enablenotrespondingdialog (TRUE);
afxolegetmessagefilter ()->setmessagependingdelay ((DWORD)-1);
The best thing to do after initializing the COM component is to set it up, like I'm adding an Excel component to my project, and here's my code that goes through.
LO ret = E_err;
:: CoInitialize (0);
if (PXL! = NULL)
{
PXL = NULL;
}
HRESULT hr = pxl.createinstance ("Excel.Application");
if (SUCCEEDED (HR))
{
Pxl->visible[0] = VARIANT_TRUE;
Pxl->visible[0] = Variant_false;
Pxl->displayalerts[0] = Variant_false;
Afxolegetmessagefilter ()->enablebusydialog (FALSE);
Afxolegetmessagefilter ()->setbusyreply (Servercall_retrylater);
Afxolegetmessagefilter ()->enablenotrespondingdialog (TRUE);
Afxolegetmessagefilter ()->setmessagependingdelay ((DWORD)-1);
ret = E_OK;
}
Else
{
ret = E_err;
}
return ret;
VC processing always pops up the server busy dialog box method