Click here to Skip to main content
15,916,318 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to change scroll bar's color of list box? Pin
Koutans19-Dec-06 22:14
Koutans19-Dec-06 22:14 
AnswerRe: how to change scroll bar's color of list box? Pin
Hamid_RT20-Dec-06 0:10
Hamid_RT20-Dec-06 0:10 
QuestionHow to detect enter Key in CHTMLEDITVIEW Pin
bengz19-Dec-06 22:13
bengz19-Dec-06 22:13 
QuestionRefresh Pin
baerten19-Dec-06 21:57
baerten19-Dec-06 21:57 
AnswerRe: Refresh Pin
Naveen19-Dec-06 22:45
Naveen19-Dec-06 22:45 
AnswerRe: Refresh [modified] Pin
baerten19-Dec-06 22:55
baerten19-Dec-06 22:55 
AnswerRe: Refresh Pin
Mark Salsbery20-Dec-06 6:53
Mark Salsbery20-Dec-06 6:53 
QuestionToolTip is not Shown Pin
poda19-Dec-06 21:50
poda19-Dec-06 21:50 
I have problem in displaying the tooltip.
In the header file of the Dialog,I declare the message handler as
<br />
afx_msg BOOL ShowMyToolTips(UINT id, NMHDR* pTTTStruct, LRESULT* pResult);<br />

In the .cpp file of the Dialog,
<br />
BEGIN_MESSAGE_MAP(CSimpleToolTipDlg, CDialog)<br />
	...	<br />
	ON_NOTIFY_EX(TTN_NEEDTEXT,0,ShowMyToolTips)	<br />
END_MESSAGE_MAP()<br />

In the OnInitDialog
<br />
BOOL CSimpleToolTipDlg::OnInitDialog()<br />
{<br />
        ...<br />
	EnableToolTips(true);//This is required	<br />
	return TRUE; <br />
}<br />

Then the definition of the message handler
<br />
BOOL CSimpleToolTipDlg::ShowMyToolTips(UINT id, NMHDR* pNMHDR, LRESULT* pResult)<br />
{<br />
    TOOLTIPTEXT *pTTT = (TOOLTIPTEXT*)pNMHDR;<br />
    UINT nID = pNMHDR->idFrom;<br />
    if(pTTT->uFlags & TTF_IDISHWND)<br />
    {<br />
        // idFrom is actually the HWND of the tool<br />
        nID = ::GetDlgCtrlID((HWND)nID);<br />
        if(nID)<br />
        {<br />
            pTTT->lpszText = "I am a ToolTip";//MAKEINTRESOURCE(nID);<br />
            pTTT->hinst = AfxGetResourceHandle();<br />
            return(TRUE);<br />
        }<br />
    }<br />
    return(FALSE);<br />
}<br />

The big problem is,ShowMyToolTips() function is not called at all.
I even tried
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, ShowMyToolTips)
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, ShowMyToolTips)

But it also does not work.
Do any one know what's wrong.
AnswerRe: ToolTip is not Shown Pin
Naveen19-Dec-06 22:35
Naveen19-Dec-06 22:35 
GeneralRe: ToolTip is not Shown Pin
poda19-Dec-06 22:45
poda19-Dec-06 22:45 
GeneralRe: ToolTip is not Shown Pin
Naveen19-Dec-06 22:48
Naveen19-Dec-06 22:48 
GeneralRe: ToolTip is not Shown Pin
poda20-Dec-06 20:35
poda20-Dec-06 20:35 
GeneralRe: ToolTip is not Shown Pin
Naveen20-Dec-06 20:41
Naveen20-Dec-06 20:41 
GeneralRe: ToolTip is not Shown Pin
poda21-Dec-06 14:45
poda21-Dec-06 14:45 
Questionstatic_cast' : cannot convert from 'class CString' to 'const char *const ' Pin
Atul2319-Dec-06 21:34
Atul2319-Dec-06 21:34 
AnswerRe: static_cast' : cannot convert from 'class CString' to 'const char *const ' Pin
sunit519-Dec-06 21:46
sunit519-Dec-06 21:46 
AnswerRe: static_cast' : cannot convert from 'class CString' to 'const char *const ' Pin
toxcct19-Dec-06 22:13
toxcct19-Dec-06 22:13 
AnswerRe: static_cast' : cannot convert from 'class CString' to 'const char *const ' Pin
CPallini19-Dec-06 22:17
mveCPallini19-Dec-06 22:17 
GeneralRe: static_cast' : cannot convert from 'class CString' to 'const char *const ' Pin
sunit519-Dec-06 22:41
sunit519-Dec-06 22:41 
GeneralRe: static_cast' : cannot convert from 'class CString' to 'const char *const ' Pin
CPallini19-Dec-06 23:23
mveCPallini19-Dec-06 23:23 
GeneralRe: static_cast' : cannot convert from 'class CString' to 'const char *const ' Pin
toxcct20-Dec-06 0:31
toxcct20-Dec-06 0:31 
GeneralRe: static_cast' : cannot convert from 'class CString' to 'const char *const ' Pin
CPallini20-Dec-06 0:41
mveCPallini20-Dec-06 0:41 
GeneralRe: static_cast' : cannot convert from 'class CString' to 'const char *const ' Pin
S Douglas20-Dec-06 0:51
professionalS Douglas20-Dec-06 0:51 
GeneralOK, I fixed it. Pin
CPallini20-Dec-06 0:59
mveCPallini20-Dec-06 0:59 
GeneralRe: OK, I fixed it. Pin
S Douglas20-Dec-06 1:02
professionalS Douglas20-Dec-06 1:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.