The code that I'm posting worked fine with v13 but it fails with V15 eval.
The call to L_DocAddPage returns ERROR_DOC_INV_IMAGE_RESOLUTION.
CDC *pDC = GetDC();
CDC MemDC;
MemDC.CreateCompatibleDC(pDC);
CBitmap Bmp;
Bmp.CreateCompatibleBitmap(pDC,m_Capture.Width(),m_Capture.Height());
CBitmap *pOldBmp = MemDC.SelectObject(&Bmp);
CDC *pDeskDC = GetDesktopWindow()->GetDC();
MemDC.BitBlt(0,0,m_Capture.Width(),m_Capture.Height(),pDeskDC,m_Capture.left,m_Capture.top,SRCCOPY);
GetDesktopWindow()->ReleaseDC(pDeskDC);
L_INT Ret;
L_InitBitmap(&BmpHandle, sizeof(BITMAPHANDLE), 0, 0, 0);
L_ChangeFromDDB(MemDC.GetSafeHdc(),&BmpHandle,sizeof(BITMAPHANDLE),(HBITMAP)Bmp.GetSafeHandle(),NULL);
if (!m_Palm || m_Pocket)
{
Ret = L_ColorResBitmap(&BmpHandle,&BmpHandle,sizeof(BITMAPHANDLE),1,CRF_OPTIMIZEDPALETTE,NULL,NULL,0,NULL,NULL);
}
if (!m_Pocket)
{
for (int i = 0; i GetSafeHdc(), /* Device context */
&BmpHandle,/* Bitmap handle */
NULL, /* Default source rectangle */
NULL, /* Default source clip area */
&MyRect, /* Destination rectangle */
NULL, /* Default destination clipping rectangle */
SRCCOPY); /* ROP3 code for a Normal Paint */
ReleaseDC(pDC);
Ret = L_DocAddPage(hDoc,&BmpHandle,0);
LANGIDS * pLangIds = NULL;
L_INT nLangCount = 0;
RECOGNIZEOPTS RecogOpts;
RECOGMODULE_TRADEOFF TradeOff;
L_INT nRet = L_DocGetDefaultSpellLanguages (hDoc, &pLangIds, &nLangCount);
if (nRet == SUCCESS)
{
nRet = L_DocGetRecognizeModuleTradeOff(hDoc, &TradeOff);
if (TradeOff != RECGMD_ACCURATE)
nRet = L_DocSetRecognizeModuleTradeOff(hDoc, RECGMD_BALANCED);
HANDPRINTOPTIONS HOptions;
HOptions.uStructSize = sizeof(HANDPRINTOPTIONS);
HOptions.bSpace = FALSE;
HOptions.nCharHeight = HOptions.nCharSpace = HOptions.nCharWidth = 0;
HOptions.style = HAND_STYLE_US;
L_DocSetHandPrintOptions(hDoc,&HOptions);
RecogOpts.uStructSize = sizeof(RECOGNIZEOPTS);
RecogOpts.nPageIndexStart = 0;
RecogOpts.nPagesCount = 1;
RecogOpts.bEnableSubSystem = TRUE;
RecogOpts.bEnableCorrection = TRUE;
RecogOpts.SpellLangId = LANG_ID_NO;
RecogOpts.pszFileName = TEXT("c:\\testrdf.rdf");
// nRet = L_DocRecognize(hDoc, &RecogOpts, NULL, NULL);
nRet = L_DocRecognize(hDoc, &RecogOpts, NULL, NULL);
RECOGCHARS *pRecChar;
L_INT32 Count;
nRet = L_DocGetRecognizedCharacters(hDoc,0,&pRecChar,&Count,sizeof(RECOGCHARS));
TRACE1("Count %d\n",Count);
m_LettersCtrl.SetWindowText(m_Letters);
if (Count < 6)
{
continue;
}
for (int i = 0; i < Count;i++)
{
m_Letters += CString(pRecChar[i].wGuessCode);
if (m_Letters[i] == '0')
{
m_Letters.SetAt(i,'O');
}
if (m_Letters[i] == '1')
{
m_Letters.SetAt(i,'I');
}
}
L_DocFreeRecognizedCharacters(hDoc,&pRecChar);