Click here to Skip to main content
15,894,896 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhardware security Pin
happycpp2-Jan-06 15:31
happycpp2-Jan-06 15:31 
QuestionCan't open more than 16 documents in my application Pin
brdavid2-Jan-06 15:04
brdavid2-Jan-06 15:04 
AnswerRe: Can't open more than 16 documents in my application Pin
PJ Arends2-Jan-06 15:23
professionalPJ Arends2-Jan-06 15:23 
GeneralRe: Can't open more than 16 documents in my application Pin
brdavid3-Jan-06 1:28
brdavid3-Jan-06 1:28 
GeneralRe: Can't open more than 16 documents in my application Pin
PJ Arends3-Jan-06 7:02
professionalPJ Arends3-Jan-06 7:02 
GeneralRe: Can't open more than 16 documents in my application Pin
brdavid5-Jan-06 4:43
brdavid5-Jan-06 4:43 
GeneralRe: Can't open more than 16 documents in my application Pin
PJ Arends5-Jan-06 18:28
professionalPJ Arends5-Jan-06 18:28 
GeneralRe: Can't open more than 16 documents in my application Pin
brdavid6-Jan-06 6:06
brdavid6-Jan-06 6:06 
okay... I think I'm on to something. Whenever I open a new document the cpu usage peaks, but then doesn't return back to a low number. In fact with each new doc the low value increases until I reach a 100%. Now apparently I can still open up documents but I have a feeling at some point I just hit the limit with whatever is eating up the CPU. I started eliminating logic from the main window, which are tabs with formviews until I got down to one tab. The application now opens up more documents than before and the CPU usage goes back down to under 5 and sometimes zero. So somewhere in my logic for the tabs I have in my main window is causing the problem. I'll give more information when I have it finally nailed.

Thanks for the help. Smile | :)

edit: I have isolated the issue, which makes this even more weird. It has to do with this call:

<br />
	pList->CreateEx(WS_EX_CLIENTEDGE, dwStyle, rect, this, IDC_ITEMLISTCONTROL);<br />

Here's the weird part. I set up the application so that I can control the number of times this value is called per document. If called once per document the cpu usage starts to increase the more documents I open until it peaks at 100%. This happens in a custom list ctrl. I have another control that uses the same CreateEx method that subclasses ListCtrl as well and I do not have this issue, so somewhere in this MyListCtrl is the issue which happens to be related to CreateEx().

Weird. Confused | :confused:

edit: update:
<br />
int CMyListCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)<br />
{<br />
	CListCtrl::OnCreate(lpCreateStruct);<br />
	//if (CListCtrl::OnCreate(lpCreateStruct) == -1)<br />
	//{<br />
	//	ASSERT(FALSE);<br />
		return -1;<br />
	//}<br />
<br />
	// When the CMyListCtrl object is created via a call to Create(), instead<br />
	// of via a dialog box template, we must subclass the header control<br />
	// window here because it does not exist when the PreSubclassWindow()<br />
	// function is called.<br />
<br />
	//SubclassHeaderControl();<br />
	//return 0;<br />
}<br />
in turning the OnCreate method into this the CPU usage stays low. When I return 0 like it should the CPU starts to increase upwards the more docs I add. This is becoming a rather difficult problem. Cry | :((
-- modified at 18:45 Friday 6th January, 2006
Questionaccessing non-static variables Pin
tonyro2-Jan-06 13:37
tonyro2-Jan-06 13:37 
AnswerRe: accessing non-static variables Pin
PJ Arends2-Jan-06 15:09
professionalPJ Arends2-Jan-06 15:09 
QuestionFlashWindowEx Pin
Dody_DK2-Jan-06 10:55
Dody_DK2-Jan-06 10:55 
AnswerRe: FlashWindowEx Pin
PJ Arends2-Jan-06 15:15
professionalPJ Arends2-Jan-06 15:15 
GeneralRe: FlashWindowEx Pin
Dody_DK2-Jan-06 23:39
Dody_DK2-Jan-06 23:39 
GeneralRe: FlashWindowEx Pin
Gavin Taylor3-Jan-06 6:32
professionalGavin Taylor3-Jan-06 6:32 
GeneralRe: FlashWindowEx Pin
Dody_DK3-Jan-06 7:47
Dody_DK3-Jan-06 7:47 
QuestionTooltip on editbox Pin
mehrdadov2-Jan-06 6:29
mehrdadov2-Jan-06 6:29 
AnswerRe: Tooltip on editbox Pin
Ravi Bhavnani2-Jan-06 8:40
professionalRavi Bhavnani2-Jan-06 8:40 
QuestionError reading from com port Pin
nitgonz2-Jan-06 5:02
nitgonz2-Jan-06 5:02 
AnswerRe: Error reading from com port Pin
krmed2-Jan-06 5:34
krmed2-Jan-06 5:34 
GeneralRe: Error reading from com port Pin
John R. Shaw2-Jan-06 19:26
John R. Shaw2-Jan-06 19:26 
GeneralRe: Error reading from com port Pin
nitgonz3-Jan-06 2:55
nitgonz3-Jan-06 2:55 
GeneralRe: Error reading from com port Pin
krmed3-Jan-06 4:44
krmed3-Jan-06 4:44 
GeneralRe: Error reading from com port Pin
krmed3-Jan-06 4:43
krmed3-Jan-06 4:43 
AnswerRe: Error reading from com port Pin
rajan.msmy2-Jan-06 18:09
rajan.msmy2-Jan-06 18:09 
QuestionToolBar ToolTip is blocked by whom? Pin
rajan.msmy2-Jan-06 3:36
rajan.msmy2-Jan-06 3:36 

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.