Click here to Skip to main content
15,884,537 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: HWND of a control. Pin
FISH78623-Aug-09 17:05
FISH78623-Aug-09 17:05 
QuestionHow to detect illegal memory consuming? Pin
Behzad Ebrahimi22-Aug-09 22:19
Behzad Ebrahimi22-Aug-09 22:19 
AnswerRe: How to detect illegal memory consuming? Pin
Chris Losinger23-Aug-09 16:13
professionalChris Losinger23-Aug-09 16:13 
GeneralRe: How to detect illegal memory consuming? Pin
Behzad Ebrahimi23-Aug-09 18:48
Behzad Ebrahimi23-Aug-09 18:48 
AnswerRe: How to detect illegal memory consuming? Pin
zhu_lin23-Aug-09 21:04
zhu_lin23-Aug-09 21:04 
GeneralRe: How to detect illegal memory consuming? Pin
Behzad Ebrahimi23-Aug-09 21:54
Behzad Ebrahimi23-Aug-09 21:54 
AnswerRe: How to detect illegal memory consuming? Pin
Roger Stoltz23-Aug-09 22:10
Roger Stoltz23-Aug-09 22:10 
AnswerRe: How to detect illegal memory consuming? Pin
Behzad Ebrahimi25-Aug-09 20:24
Behzad Ebrahimi25-Aug-09 20:24 
I found my problem using Easy Detection of Memory Leaks[^].

BOOL CSmartToolTip::SetTipText(CWnd *pTipOwnerWnd, CString strTip )
{
	TOOLINFO ti;

	_CreateTipWnd();

	// Fill tool tip info structure:
	// (Set flags to indicates that the uId member is the window handle
	// to the tool, and to indicate that the ToolTip control should subclass
	// the tool's window to intercept messages.)
	ti.cbSize = sizeof(ti);						// size of this structure
	ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;		// flags
	ti.hwnd = pTipOwnerWnd->GetParent()->GetSafeHwnd();	// handle to the window that contains the tool
	ti.uId = (UINT)pTipOwnerWnd->GetSafeHwnd();			// application-defined identifier of the tool
	ti.hinst = AfxGetResourceHandle();				// handle to the instance that contains the string resource for the tool
	ti.lpszText = (LPTSTR)((LPCTSTR)strTip);						// pointer to the buffer that contains the text for the tool
	
	// Send add tool message and return result:
	//	return CToolTipCtrl::AddTool( pTipOwnerWnd->GetParent(), 1 );
	return((BOOL)SendMessage(TTM_ADDTOOL, 0, (LPARAM)&ti));
}


void CSmartToolTip::_CreateTipWnd()
{
	// We must create its once!
	if( ! IsWindow(*this) )
	{
		// Create ToolTip control
		this->Create( NULL );
		
		SetTipBkColor( RGB( 255, 255, 0) );
		SetTipTextColor( RGB( 0, 0, 0) );
		
		// Enable multiline
		::SendMessage( *this, TTM_SETMAXTIPWIDTH, 0, 
			(LPARAM)(INT) MAKELONG(400, 0));
	}
}


The problem located in above code. I periodically call above function in my application.
But why leak? Can any one help me please?
Questioninsert bitmap on SDI Pin
Amin.Abdi22-Aug-09 21:15
Amin.Abdi22-Aug-09 21:15 
AnswerRe: insert bitmap on SDI Pin
Hamid_RT22-Aug-09 22:18
Hamid_RT22-Aug-09 22:18 
GeneralRe: insert bitmap on SDI Pin
Amin.Abdi22-Aug-09 22:39
Amin.Abdi22-Aug-09 22:39 
GeneralRe: insert bitmap on SDI Pin
Iain Clarke, Warrior Programmer23-Aug-09 4:23
Iain Clarke, Warrior Programmer23-Aug-09 4:23 
GeneralRe: insert bitmap on SDI Pin
Amin.Abdi23-Aug-09 4:34
Amin.Abdi23-Aug-09 4:34 
GeneralRe: insert bitmap on SDI Pin
Hamid_RT27-Aug-09 5:21
Hamid_RT27-Aug-09 5:21 
QuestionFunction overloading.. Pin
kumar sanghvi22-Aug-09 3:28
kumar sanghvi22-Aug-09 3:28 
AnswerRe: Function overloading.. Pin
Rajesh R Subramanian22-Aug-09 4:35
professionalRajesh R Subramanian22-Aug-09 4:35 
AnswerRe: Function overloading.. Pin
Stuart Dootson22-Aug-09 6:46
professionalStuart Dootson22-Aug-09 6:46 
Questionpointer Pin
kumar sanghvi21-Aug-09 23:56
kumar sanghvi21-Aug-09 23:56 
AnswerRe: pointer [modified] Pin
Rajesh R Subramanian22-Aug-09 0:05
professionalRajesh R Subramanian22-Aug-09 0:05 
GeneralRe: pointer Pin
kumar sanghvi22-Aug-09 0:21
kumar sanghvi22-Aug-09 0:21 
GeneralRe: pointer Pin
Rajesh R Subramanian22-Aug-09 2:10
professionalRajesh R Subramanian22-Aug-09 2:10 
GeneralRe: pointer Pin
harold aptroot22-Aug-09 9:04
harold aptroot22-Aug-09 9:04 
GeneralRe: pointer Pin
Rajesh R Subramanian22-Aug-09 19:05
professionalRajesh R Subramanian22-Aug-09 19:05 
AnswerRe: pointer Pin
Rajesh R Subramanian22-Aug-09 19:06
professionalRajesh R Subramanian22-Aug-09 19:06 
AnswerRe: pointer Pin
harold aptroot23-Aug-09 7:54
harold aptroot23-Aug-09 7:54 

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.