Click here to Skip to main content
15,890,282 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionrunning an exe created with visual c++ Pin
jgds16-Oct-06 2:02
jgds16-Oct-06 2:02 
AnswerRe: running an exe created with visual c++ Pin
Trollslayer16-Oct-06 9:21
mentorTrollslayer16-Oct-06 9:21 
Questioncopy image to clipboard Pin
priyank_ldce16-Oct-06 1:58
priyank_ldce16-Oct-06 1:58 
AnswerRe: copy image to clipboard Pin
Owner drawn16-Oct-06 2:08
Owner drawn16-Oct-06 2:08 
AnswerRe: copy image to clipboard Pin
Hamid_RT17-Oct-06 6:41
Hamid_RT17-Oct-06 6:41 
QuestionMemory Monitoring Pin
Programm3r16-Oct-06 1:57
Programm3r16-Oct-06 1:57 
AnswerRe: Memory Monitoring Pin
Programm3r16-Oct-06 2:05
Programm3r16-Oct-06 2:05 
Questiontool tip problem in custom activex control Pin
praveensethiya16-Oct-06 1:14
praveensethiya16-Oct-06 1:14 
D'Oh! | :doh: A activex control was created that gets called through a php page with ms word 2003 embeded in a dialog box, in the activex control.
a tool bar is also created in the derivation of MyDialog::OnInitDialog() with some buttons in the dialog box like this:

if (!m_ToolBar.Create(this, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_TOOLTIPS | CBRS_FLYBY) || !m_ToolBar.LoadToolBar(IDR_MAINFRAME))

{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
// Move the toolbar so it is VISIBLE on the screen.
CRect rc;
GetClientRect(&rc);
rc.bottom = rc.top + 34;
rc.bottom = rc.left + 30;
m_ToolBar.MoveWindow(&rc);
m_ToolBar.ShowWindow(SW_SHOW);

RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);
EnableToolTips(true); //enable tool tips

//////////////////in its message map i'm calling OnToolTipNotify////////

BEGIN_MESSAGE_MAP(CDlgDocument, CDialog)
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipNotify)
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipNotify)
END_MESSAGE_MAP()

///////declaration of OnToolTipNotify in the 'void MyDialog:public CDialog'///

afx_msg BOOL OnToolTipNotify(UINT id, NMHDR *pNMHDR,LRESULT *pResult);

///////////and definitition of OnToolTipNotify is://////

BOOL CDlgDocument::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;

TCHAR szFullText[256];
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
{
// don't handle the message if no string resource found
if (AfxLoadString(nID, szFullText) == 0)
return FALSE;

// this is the command id, not the button index
AfxExtractSubString(strTipText, szFullText, 1, '\n');
}

#ifndef _UNICODE
if (pNMHDR->code == TTN_NEEDTEXTA)
lstrcpyn(pTTTA->szText, strTipText, _countof(pTTTA->szText));
else
_mbstowcsz(pTTTW->szText, strTipText, _countof(pTTTW->szText));
#else
if (pNMHDR->code == TTN_NEEDTEXTA)
_wcstombsz(pTTTA->szText, strTipText, _countof(pTTTA->szText));
else
lstrcpyn(pTTTW->szText, strTipText, _countof(pTTTW->szText));
#endif
*pResult = 0;
return TRUE; // message was handled
}

i've tried most of the ideas on the net but couldn't view the tool tip.
kindly help me out how tool tips can be displayed for the tool bar
buttons?
note: the activex control is executing in the internet explorer 6.0.

praveen k. sethiya
AnswerRe: set focus in edit box Pin
Parthi_Appu16-Oct-06 0:09
Parthi_Appu16-Oct-06 0:09 
GeneralRe: set focus in edit box Pin
minkowski16-Oct-06 0:36
minkowski16-Oct-06 0:36 
GeneralRe: set focus in edit box Pin
Hamid_RT16-Oct-06 9:04
Hamid_RT16-Oct-06 9:04 
General[OT] : signature Pin
toxcct16-Oct-06 0:39
toxcct16-Oct-06 0:39 
GeneralRe: [OT] : signature Pin
Parthi_Appu16-Oct-06 0:58
Parthi_Appu16-Oct-06 0:58 
GeneralRe: [OT] : signature Pin
toxcct16-Oct-06 1:32
toxcct16-Oct-06 1:32 
Questionset focus in edit box Pin
minkowski15-Oct-06 23:53
minkowski15-Oct-06 23:53 
AnswerRe: set focus in edit box Pin
toxcct16-Oct-06 0:07
toxcct16-Oct-06 0:07 
QuestionNot able to add event handlers!! Pin
SteamEngine15-Oct-06 22:17
SteamEngine15-Oct-06 22:17 
AnswerRe: Not able to add event handlers!! Pin
Cedric Moonen15-Oct-06 22:25
Cedric Moonen15-Oct-06 22:25 
GeneralRe: Not able to add event handlers!! Pin
prasad_som15-Oct-06 22:46
prasad_som15-Oct-06 22:46 
AnswerRe: Not able to add event handlers!! Pin
Hamid_RT17-Oct-06 6:41
Hamid_RT17-Oct-06 6:41 
QuestionHow to list Port Name in Visual C++ ? Pin
Gabriel Fernandez15-Oct-06 22:06
Gabriel Fernandez15-Oct-06 22:06 
AnswerRe: How to list Port Name in Visual C++ ? Pin
BadKarma15-Oct-06 22:46
BadKarma15-Oct-06 22:46 
GeneralRe: How to list Port Name in Visual C++ ? Pin
Gabriel Fernandez15-Oct-06 23:54
Gabriel Fernandez15-Oct-06 23:54 
QuestionADO execute problem Pin
_tasleem15-Oct-06 21:23
_tasleem15-Oct-06 21:23 
Questionole/db connection Pin
With_problem15-Oct-06 21:01
With_problem15-Oct-06 21:01 

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.