Hello All,
Merry Christmas and Happy new year ..
I have to again do some changes to legacy MFC code !
There is some renderer function to draw lines..But now i need to add a rectangle to display the list of cells and their power levels.
I have added a following function:
Code:void EmfCellListRend::DrawRectangle(EmfCellListRendDrawingParams* pParams, TDC& dc, CEmfCellList *pCelllist)
{
ILogicalLayerManager& rLogLayManager = DataManager::GetInstance().GetLogicalLayer();
//Rectangle(dc.GetHDC(), midPointX - m_markerSize, midPointY - m_markerSize, midPointX + m_markerSize, midPointY + m_markerSize);
//GetWindowRect ( dc.GetHDC()
//int rectHeight = DrawText( hMemDc, text.c_str(), text.size(), &rc, DT_CALCRECT |DT_WORDBREAK );
// Get formating rectangle height
// Populate the cell list got from the renderer.
tstring message = _T("EMF Cell list");
for (int i = 0; i < (int)pParams->GetNumCovCells(); i++)
{
const MultiTechCell* pObjCell((const MultiTechCell*)rLogLayManager.Find(OT_MULTI_TECH_CELL, pCelllist[i].m_CellKey));
tstring str3 = _T("\n");
tstring str4 = _T(pObjCell->GetID());
tstring str5 = _T(std::to_string(pCelllist[i].m_fRxSignal_dBm));
message +=str3+str4+str5;
}
HWND hwnd = WindowFromDC(dc);
RECT rect;
HWND bgHandle(0);
GetClientRect(hwnd, &rect);
SetTextColor(dc, 0x00000000);
SetBkMode(dc, TRANSPARENT);
rect.left = 40;
rect.top = 10;
DrawText(dc, message.c_str(), -1, &rect, DT_SINGLELINE | DT_NOCLIP );
//DrawText(dc, message.c_str(), -1, &rect, DT_CALCRECT|DT_WORDBREAK );
DeleteDC(dc);
dc.RestorePen();
}
The above drawtext somehow doesnot honour new lines..
Also if i change to below commented Drawtext, it doesnot display anything at all..
I tried to install and create a new MFC project in my home PC, and both of above DrawText doesnot work !!!... I knew little MFC but never drew with MFC
Thanks a lot for the help

