Click here to Skip to main content
15,911,132 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: __asm and C++ inheritance Pin
David Crow12-Mar-04 9:26
David Crow12-Mar-04 9:26 
GeneralRe: __asm and C++ inheritance Pin
jk6112-Mar-04 9:49
jk6112-Mar-04 9:49 
GeneralLINK : fatal error LNK1209 Pin
melwyn12-Mar-04 4:58
melwyn12-Mar-04 4:58 
GeneralRe: LINK : fatal error LNK1209 Pin
David Crow12-Mar-04 5:10
David Crow12-Mar-04 5:10 
GeneralRe: LINK : fatal error LNK1209 Pin
melwyn12-Mar-04 5:43
melwyn12-Mar-04 5:43 
GeneralRe: LINK : fatal error LNK1209 Pin
Steve S12-Mar-04 5:48
Steve S12-Mar-04 5:48 
GeneralRe: LINK : fatal error LNK1209 Pin
melwyn12-Mar-04 5:54
melwyn12-Mar-04 5:54 
GeneralTooltips for ToolBar. Pin
bin892212-Mar-04 4:45
bin892212-Mar-04 4:45 
Hello everyone,
I used the following code to implement the tooltip for a toolbar. But the tooltip won't be displayed when the toolbar window is not active. I know that I can set TTS_ALWAYSTIP to solve this problem. But I don't know how to set it. There is no CToolTipCtrl in my application.
Thanks a lot in advance.

BEGIN_MESSAGE_MAP(CMyView, CView)
...
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipNotify)
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipNotify)
END_MESSAGE_MAP()

void CMyView::OnInitialUpdate()
{
CView::OnInitialUpdate();

CEdit* pEdit = new CEdit;
pEdit->Create(ES_MULTILINE | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER,
CRect(10, 10, 100, 100), this, 111);
EnableToolTips(TRUE); // enable tool tips for view
}

//Notification handler
BOOL CMyView::OnToolTipNotify(UINT id, NMHDR *pNMHDR,
LRESULT *pResult)
{
// need to handle both ANSI and UNICODE versions of the message
TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR;
TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR;
CString strTipText;
UINT nID = pNMHDR->idFrom;
if (pNMHDR->code == TTN_NEEDTEXTA && (pTTTA->uFlags & TTF_IDISHWND) ||
pNMHDR->code == TTN_NEEDTEXTW && (pTTTW->uFlags & TTF_IDISHWND))
{
// idFrom is actually the HWND of the tool
nID = ::GetDlgCtrlID((HWND)nID);
}

if (nID != 0) // will be zero on a separator
strTipText.Format("Control ID = %d", nID);

if (pNMHDR->code == TTN_NEEDTEXTA)
lstrcpyn(pTTTA->szText, strTipText, sizeof(pTTTA->szText));
else
_mbstowcsz(pTTTW->szText, strTipText, sizeof(pTTTW->szText));
*pResult = 0;

return TRUE; // message was handled
}

Thanks
Bin

GeneralSAFEARRAY Question Pin
Nick Parker12-Mar-04 4:40
protectorNick Parker12-Mar-04 4:40 
GeneralRe: SAFEARRAY Question Pin
Steve S12-Mar-04 5:50
Steve S12-Mar-04 5:50 
GeneralProblem Solved Pin
Nick Parker12-Mar-04 8:19
protectorNick Parker12-Mar-04 8:19 
QuestionHow to read a cookie in C++ Pin
Anonymous12-Mar-04 4:39
Anonymous12-Mar-04 4:39 
AnswerRe: How to read a cookie in C++ Pin
David Crow12-Mar-04 5:07
David Crow12-Mar-04 5:07 
GeneralRe: How to read a cookie in C++ Pin
black97610-May-04 3:50
black97610-May-04 3:50 
GeneralRe: How to read a cookie in C++ Pin
David Crow10-May-04 3:59
David Crow10-May-04 3:59 
Questiondid u use video memory before? Pin
includeh1012-Mar-04 3:55
includeh1012-Mar-04 3:55 
AnswerRe: did u use video memory before? Pin
antlers12-Mar-04 5:49
antlers12-Mar-04 5:49 
GeneralRe: did u use video memory before? Pin
includeh1012-Mar-04 16:13
includeh1012-Mar-04 16:13 
Generaldebug problem Pin
star fish12-Mar-04 3:13
star fish12-Mar-04 3:13 
GeneralRe: debug problem Pin
Tim Smith12-Mar-04 4:03
Tim Smith12-Mar-04 4:03 
GeneralRe: debug problem Pin
star fish12-Mar-04 4:25
star fish12-Mar-04 4:25 
GeneralTitle bar.. Pin
Dennis L12-Mar-04 3:12
Dennis L12-Mar-04 3:12 
GeneralRe: Title bar.. Pin
Prakash Nadar12-Mar-04 3:29
Prakash Nadar12-Mar-04 3:29 
GeneralRe: Title bar.. Pin
Gary Wheeler12-Mar-04 4:24
Gary Wheeler12-Mar-04 4:24 
QuestionHow to insert a picture inmy dialog box Pin
Deepak Samuel12-Mar-04 2:18
Deepak Samuel12-Mar-04 2:18 

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.