I have an MFC C++ application running on Win7 rebuilt with VS2013. It uses a custom OCX control. On about the 4th call to the OCX the COleDispatchDriver::InvokeHelper method calls Invoke which results an exception 61706 "Insufficient Memory". This app has been built and run successfully for many years on previous version of Visual Studio (not sure which it was originally built with). The call from the application code which generates the exception is:
m_Sig1.LCDWriteString( 0, 2, 100, 100, 0, 0, 0, "Testing 123" );
I've stepped into this call and through the Invoke about 4 levels deep and get to this call in library dll oledisp2.cpp
void COleDispatchDriver::InvokeHelperV(DISPID dwDispID, WORD wFlags,
VARTYPE vtRet, void* pvRet, const BYTE* pbParamInfo, va_list argList)
. . .
// make the call
SCODE sc = m_lpDispatch->Invoke(dwDispID, IID_NULL, 0, wFlags,
&dispparams, pvarResult, &excepInfo, &nArgErr);
The status code sc is returned as 0x80020009 which is DISP_E_EXCEPTION which means "An exception occurred" and the exception info is:
exceptInfo
wCode = 61706
bstrSource = "SigPlus"
bstrDescription = "Insufficient memory to perform operation."
bstrHelpFile = 0
scode = 0
I've tried to step into the m_lpDispatch->Invoke call but the debugger is only showing assembly language saying there is no symbol info for the called module which seems strange as it is a member of the same class (or a parent) that the call is from. As I stepped though the InvokeHelper methods I observed that all of the 8 passed parameters are recognized and processed correctly up to the point of calling Invoke(). Not being able to step into Invoke makes it impossible to see where the memory allocation that is causing an "Insufficient Memory" issue.
I've also tried to build with VS2010 and get the same error.
Other things I've tried is switching from static MFC libs to DLL MFC but the results are the same. I still get "Insufficient Memory" error and can't debug with symbols into the Invoke() call.
I've tried to look up the 61706 error for a detailed description from Microsoft but only found this link which wasn't very informative.
User contributions licensed under CC BY-SA 3.0