problem with tool tip

answerme's Avatar, Join Date: Dec 2007
Ambitious contributor
I am facing problem with my the tool tip
I have 2 bit map images & i want to display to display there respective values when iam putting cursor on those bitmap images. But whenever my cursor point to both bitmap images ,It is showing the same values.

Code:
void CScenGenView::OnMouseMove(UINT nFlags, CPoint point)
{
CString le le1;
if(texture_land[0]==2)
	{
		if(((point.x >=tcx-5)&&(point.x <=tcx+5))&&((point.y >= tcy-5)&&(point.y <= tcy+5)))
		{
			//m_objToolTipCtrl.UpdateTipText(le,this);
			le.Format("DADC\nName:%s\nLatitude:%lf\nLongitude:%lf %d ",objFlightParam.m_strEntId,fLat,fLong,stTgtPos.entityType,ENT_LAND);
			m_objToolTipCtrl.SetMaxTipWidth(100);
			m_objToolTipCtrl.SetDelayTime(10000,10000);
			/*m_objToolTipCtrl.AddTool(this,le,2,IDB_BITMAP5);*/
			m_objToolTipCtrl.SetTipBkColor(105);
			m_objToolTipCtrl.SetTipTextColor(RGB(12,45,56));  
			m_objToolTipCtrl.AddTool(this,le);
			Invalidate(TRUE);
			UpdateWindow();
		}
	}

	if(texture_land[1]==3)
	{ 

		if(((point.x >=tcx-5)&&(point.x <=tcx+5))&&((point.y >= tcy-5)&&(point.y <= tcy+5)))
		{

			le1.Format("ADOC\nName:%s\nLatitude:%lf\nLongitude:%lf %d ",objFlightParam.m_strEntId,fLat,fLong,stTgtPos.entityType,ENT_LAND);
			m_objToolTipCtrl.SetMaxTipWidth(100);
			m_objToolTipCtrl.SetDelayTime(10000,10000);
			m_objToolTipCtrl.SetTipBkColor(225);
			m_objToolTipCtrl.SetTipTextColor(RGB(120,45,56));  
			m_objToolTipCtrl.AddTool(this,le1);
			/*m_objToolTipCtrl.AddTool(IDB_BITMAP4,le);*/
			//m_objToolTipCtrl.UpdateTipText(le,this);
			/*m_objToolTipCtrl.AddTool(this,le,3,IDB_BITMAP4);*/
			Invalidate(TRUE);
			UpdateWindow();
		}
	}
}
I am Able to see only le1.format output (marked with bold) in both the images
Any solution ?
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
I hate tooltips. If I want to know what something is I RTFM. Tooltips usually appear in front of something you're trying to look at, obscuring your vision by displaying something you already know.

Then they have a timeout that's too short so on the one occasion in 2000000000000000000000000000000 that you do actually want to read what it says, it disappears before you get the chance.