Click here to Skip to main content
15,915,742 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: HextoCString conversion Pin
Richard MacCutchan7-Jan-11 0:19
mveRichard MacCutchan7-Jan-11 0:19 
GeneralRe: HextoCString conversion Pin
Cool_Dev6-Jan-11 23:32
Cool_Dev6-Jan-11 23:32 
QuestionRe: HextoCString conversion Pin
David Crow7-Jan-11 4:15
David Crow7-Jan-11 4:15 
AnswerRe: HextoCString conversion Pin
Nuri Ismail6-Jan-11 22:55
Nuri Ismail6-Jan-11 22:55 
GeneralRe: HextoCString conversion Pin
S p k 5217-Jan-11 1:01
S p k 5217-Jan-11 1:01 
QuestionActiveX Component use 2D graph? Pin
mathivanaan6-Jan-11 17:40
mathivanaan6-Jan-11 17:40 
AnswerRe: ActiveX Component use 2D graph? Pin
_AnsHUMAN_ 6-Jan-11 18:09
_AnsHUMAN_ 6-Jan-11 18:09 
QuestionOne-click close inactive child modeless dialog Pin
Tadeusz Westawic6-Jan-11 1:28
Tadeusz Westawic6-Jan-11 1:28 
I am self-taught in C++ and this is as deep as I've ever been in messaging.

I have a modeless parent dialog maintaining a typed ptr list of modeless child dialog pointers. The children are all of the same class and hold memory and file resources (sets of parts and subassembly populations). The parent modeless supervises set operations on the children: unary transforms such as rotations, and binary operations such as set intersection, etc. So the parent is usually holding a kind of focus on one or two of the child operands.

I have been several days now, learning different ways that the parent dialog can crash via a null position pointer in the collection class operations, or crash via a pointer to a deleted child. I'm not crying about it, I needed the knowlege, anyway.

At this point my code no longer crashes but I have to perform two mouse clicks to close an inactive child; first click activates and second click closes ("close" means user clicked the X-button in the menu bar). The activation click causes the parent to lose its hold on current operands. Here are my event captures:

int CPop::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
	{
	//	If user moused sys menu bar, let OnSysCommand() handle it.

	if(nHitTest != HTSYSMENU)
		{
		GetParent()->PostMessageW(WMU_POP_TO_POPMAN_CHILD_M_ACTIVE, (WPARAM)0, m_ptoken);
		}
	//	Don't call base.
	//return CDialog::OnMouseActivate(pDesktopWnd, MY_nHitTest, message);

	//	Tell Wnd to ignore MA message.
	return MA_ACTIVATEANDEAT;
	}


void CPop::OnSysCommand(UINT nID, LPARAM lParam)
	{
	//	The one and only way to close a child Pop without closing parent.

	if((0xfff0 & nID) == SC_CLOSE)
		{
		OnClose();
		}
	else
		{
		GetParent()->PostMessageW(WMU_POP_TO_POPMAN_CHILD_M_ACTIVE, (WPARAM)0, m_ptoken);
		//	Don't call base.
		//CDialog::OnSysCommand(nID, lParam);
		}
	}



I saw a #define HTCLOSE in winuser but it is not listed in the docs for OnMouseActivate(). Of course I tried it but it is unreliable.

Child acivation causes the parent to lose "currency" of previously activated children, a real pia.

I would like to know a method for one-click closing an inactive child. Just point me to an article if there is one.
Tadeusz Westawic

Sum quid sum.

QuestionJPEG Image to an array format Pin
raju_shiva6-Jan-11 0:38
raju_shiva6-Jan-11 0:38 
AnswerRe: JPEG Image to an array format Pin
User 74293386-Jan-11 1:03
professionalUser 74293386-Jan-11 1:03 
AnswerRe: JPEG Image to an array format Pin
Cool_Dev6-Jan-11 3:21
Cool_Dev6-Jan-11 3:21 
AnswerRe: JPEG Image to an array format Pin
Arman S.6-Jan-11 9:44
Arman S.6-Jan-11 9:44 
AnswerRe: JPEG Image to an array format Pin
Paresh Chitte6-Jan-11 18:42
Paresh Chitte6-Jan-11 18:42 
AnswerRe: JPEG Image to an array format Pin
Chris Losinger7-Jan-11 5:51
professionalChris Losinger7-Jan-11 5:51 
QuestionCustom window title bar => system buttons stuffed [modified] Pin
Leif Goodwin5-Jan-11 22:07
Leif Goodwin5-Jan-11 22:07 
GeneralRe: Custom window title bar => system buttons stuffed Pin
Code-o-mat5-Jan-11 23:05
Code-o-mat5-Jan-11 23:05 
GeneralRe: Custom window title bar => system buttons stuffed Pin
Leif Goodwin5-Jan-11 23:20
Leif Goodwin5-Jan-11 23:20 
QuestionChange Menu Text Pin
john56325-Jan-11 21:04
john56325-Jan-11 21:04 
AnswerRe: Change Menu Text Pin
Richard MacCutchan5-Jan-11 21:33
mveRichard MacCutchan5-Jan-11 21:33 
QuestionCreateProcess problem in Windows service for Visual Studio c++ 2008 Pin
Member 24308175-Jan-11 17:58
Member 24308175-Jan-11 17:58 
AnswerRe: CreateProcess problem in Windows service for Visual Studio c++ 2008 Pin
Rajesh R Subramanian5-Jan-11 19:43
professionalRajesh R Subramanian5-Jan-11 19:43 
AnswerRe: CreateProcess problem in Windows service for Visual Studio c++ 2008 Pin
Chris Meech6-Jan-11 9:54
Chris Meech6-Jan-11 9:54 
QuestionCArray storage options Pin
David Crow5-Jan-11 10:12
David Crow5-Jan-11 10:12 
AnswerRe: CArray storage options Pin
CPallini5-Jan-11 10:36
mveCPallini5-Jan-11 10:36 
QuestionRe: CArray storage options Pin
David Crow5-Jan-11 10:50
David Crow5-Jan-11 10:50 

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.