Click here to Skip to main content
15,902,636 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem of Property of Configuration Pin
Richard MacCutchan31-Mar-12 21:45
mveRichard MacCutchan31-Mar-12 21:45 
AnswerRe: Problem of Property of Configuration Pin
Jochen Arndt28-Mar-12 1:03
professionalJochen Arndt28-Mar-12 1:03 
GeneralRe: Problem of Property of Configuration Pin
doanhanam31-Mar-12 21:27
doanhanam31-Mar-12 21:27 
QuestionI can't figure out how to extract my match from regex Pin
jkirkerx27-Mar-12 8:50
professionaljkirkerx27-Mar-12 8:50 
AnswerI think I figured it out Pin
jkirkerx27-Mar-12 9:56
professionaljkirkerx27-Mar-12 9:56 
QuestionTooltip issue with dialog app Pin
David Crow27-Mar-12 7:21
David Crow27-Mar-12 7:21 
GeneralRe: Tooltip issue with dialog app Pin
Code-o-mat27-Mar-12 8:51
Code-o-mat27-Mar-12 8:51 
GeneralRe: Tooltip issue with dialog app Pin
David Crow27-Mar-12 9:21
David Crow27-Mar-12 9:21 
Code-o-mat wrote:
Show us some relevant code...
BOOL CMyDialog::OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult)
{
    ENSURE_ARG(pNMHDR != NULL);
    ENSURE_ARG(pResult != NULL);
    ASSERT(pNMHDR->code == TTN_NEEDTEXTA || pNMHDR->code == TTN_NEEDTEXTW);

    // need to handle both ANSI and UNICODE versions of the message
    TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR;
    TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR;
    TCHAR szFullText[256];
    UINT_PTR nID = pNMHDR->idFrom;
    BOOL bReturn FALSE;

    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
    {
        // don't handle the message if no string resource found
        if (AfxLoadString((UINT)nID, szFullText) != 0)
        {
#ifndef _UNICODE
            if (pNMHDR->code == TTN_NEEDTEXTA)
                strncpy_s(pTTTA->szText, _countof(pTTTA->szText), strFullText, _TRUNCATE);
            else
                _mbstowcsz(pTTTW->szText, strFullText, _countof(pTTTW->szText));
#else
            if (pNMHDR->code == TTN_NEEDTEXTA)
                _wcstombsz(pTTTA->szText, strFullText, _countof(pTTTA->szText));
            else
                wcsncpy_s(pTTTW->szText, _countof(pTTTW->szText), strFullText, _TRUNCATE);
#endif

            bReturn = TRUE;
	}
    }

    *pResult = 0;

    // bring the tooltip window above other popup windows
    ::SetWindowPos(pNMHDR->hwndFrom, HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE | SWP_NOOWNERZORDER);

    return bReturn;
}



Code-o-mat wrote:
...show us the assertion that fails, please.
line 896 of wincore.cpp:

ASSERT(::IsWindow(m_hWnd));

"One man's wage rise is another man's price increase." - Harold Wilson

"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous



modified 28-Mar-12 15:01pm.

GeneralRe: Tooltip issue with dialog app Pin
Code-o-mat27-Mar-12 9:34
Code-o-mat27-Mar-12 9:34 
GeneralRe: Tooltip issue with dialog app Pin
David Crow27-Mar-12 9:47
David Crow27-Mar-12 9:47 
GeneralRe: Tooltip issue with dialog app Pin
Code-o-mat27-Mar-12 10:48
Code-o-mat27-Mar-12 10:48 
GeneralRe: Tooltip issue with dialog app Pin
David Crow27-Mar-12 10:58
David Crow27-Mar-12 10:58 
GeneralRe: Tooltip issue with dialog app Pin
Code-o-mat27-Mar-12 11:28
Code-o-mat27-Mar-12 11:28 
GeneralRe: Tooltip issue with dialog app Pin
David Crow27-Mar-12 17:06
David Crow27-Mar-12 17:06 
GeneralRe: Tooltip issue with dialog app Pin
Randor 27-Mar-12 13:58
professional Randor 27-Mar-12 13:58 
GeneralRe: Tooltip issue with dialog app Pin
David Crow27-Mar-12 17:10
David Crow27-Mar-12 17:10 
GeneralRe: Tooltip issue with dialog app Pin
Randor 27-Mar-12 22:19
professional Randor 27-Mar-12 22:19 
GeneralRe: Tooltip issue with dialog app Pin
David Crow28-Mar-12 2:30
David Crow28-Mar-12 2:30 
AnswerRe: Tooltip issue with dialog app Pin
Jochen Arndt28-Mar-12 3:40
professionalJochen Arndt28-Mar-12 3:40 
GeneralRe: Tooltip issue with dialog app Pin
David Crow28-Mar-12 3:46
David Crow28-Mar-12 3:46 
GeneralRe: Tooltip issue with dialog app Pin
Jochen Arndt28-Mar-12 3:59
professionalJochen Arndt28-Mar-12 3:59 
GeneralRe: Tooltip issue with dialog app Pin
David Crow28-Mar-12 4:07
David Crow28-Mar-12 4:07 
SuggestionRe: Tooltip issue with dialog app Pin
Jochen Arndt28-Mar-12 5:02
professionalJochen Arndt28-Mar-12 5:02 
GeneralRe: Tooltip issue with dialog app Pin
Randor 28-Mar-12 8:24
professional Randor 28-Mar-12 8:24 
QuestionRe: Tooltip issue with dialog app Pin
David Crow28-Mar-12 8:59
David Crow28-Mar-12 8:59 

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.