Click here to Skip to main content
16,008,010 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Crop large file without temp file? Pin
Neville Franks6-Mar-04 21:06
Neville Franks6-Mar-04 21:06 
GeneralRe: Crop large file without temp file? Pin
Prakash Nadar6-Mar-04 21:37
Prakash Nadar6-Mar-04 21:37 
GeneralRe: Crop large file without temp file? Pin
Neville Franks6-Mar-04 22:19
Neville Franks6-Mar-04 22:19 
GeneralRe: Crop large file without temp file? Pin
Prakash Nadar7-Mar-04 0:04
Prakash Nadar7-Mar-04 0:04 
GeneralRe: Crop large file without temp file? Pin
Michael Dunn7-Mar-04 6:29
sitebuilderMichael Dunn7-Mar-04 6:29 
GeneralRe: Crop large file without temp file? Pin
Alexander M.,7-Mar-04 10:15
Alexander M.,7-Mar-04 10:15 
GeneralRe: Crop large file without temp file? Pin
Neville Franks7-Mar-04 11:50
Neville Franks7-Mar-04 11:50 
GeneralRef Counting Pin
monrobot136-Mar-04 18:52
monrobot136-Mar-04 18:52 
I have a form with some edit boxes that do validation when they lose focus. I have an error variable (int) that keeps track of whether there was an error when the control lost focus. If there is an error it increases the ref count, and if there is no error it decreases the count. I'm having some trouble wrapping my head around how to work this logically. The system encounters several errors in keeping track. For example if I tab off the first edit and there is an error the count is increased to 1. If on the next box I enter a valid value and tab off the error count is decreased since there was no error. This has the effect of taking the ref count to 0 even though the first box still has an error. The only thing I've come up with so far is to have a boolean flag that is set when the ref is increased inside the function and if it wasn't then I shouldn't decrement it when it loses focus, but I don't really like that idea. Any ideas, links, or pushes in the right directions would be very appreciated. Here is some sample code of the KillFocus
if (VerifyCircuit ()) {
		// the circuit is valid decrease the error count unless it's already zero
		if (0 != m_nFieldError) { DelErrRef (); }
		// if there are no errors remove the error warning
		if (0 == m_nFieldError)
			GetDlgItem (IDC_ERROR)->ShowWindow (SW_HIDE);
		
		// remove the error string if it's there
		ErrorString (IDC_CIRCUIT_ERROR, FALSE);
	}
	else {
		// there is an error in the circuit, increase the error count
		AddErrRef ();

		// add the error string if not already there
		ErrorString (IDC_CIRCUIT_ERROR);
		// show the error warning
		GetDlgItem (IDC_ERROR)->ShowWindow (SW_SHOW);
	}
Sorry about the lenghty post.

- monrobot13
GeneralRe: Ref Counting Pin
Neville Franks6-Mar-04 21:10
Neville Franks6-Mar-04 21:10 
GeneralRe: Ref Counting Pin
monrobot137-Mar-04 2:25
monrobot137-Mar-04 2:25 
GeneralPassing information among different views Pin
DaBears6-Mar-04 17:53
DaBears6-Mar-04 17:53 
GeneralRe: Passing information among different views Pin
Neville Franks6-Mar-04 21:16
Neville Franks6-Mar-04 21:16 
GeneralCompiling problem Pin
john.angel6-Mar-04 16:25
john.angel6-Mar-04 16:25 
GeneralRe: Compiling problem Pin
Prakash Nadar6-Mar-04 16:49
Prakash Nadar6-Mar-04 16:49 
GeneralRe: Compiling problem Pin
john.angel6-Mar-04 16:52
john.angel6-Mar-04 16:52 
GeneralMFC Pin
Archer2826-Mar-04 15:00
Archer2826-Mar-04 15:00 
GeneralRe: MFC Pin
Prakash Nadar6-Mar-04 15:07
Prakash Nadar6-Mar-04 15:07 
GeneralRe: MFC Pin
Archer2826-Mar-04 18:30
Archer2826-Mar-04 18:30 
GeneralRe: MFC Pin
Archer2826-Mar-04 18:32
Archer2826-Mar-04 18:32 
GeneralRe: MFC Pin
Prakash Nadar6-Mar-04 20:22
Prakash Nadar6-Mar-04 20:22 
GeneralTrouble with GetLogicalDrives() function Pin
Dev5786-Mar-04 13:28
Dev5786-Mar-04 13:28 
GeneralRe: Trouble with GetLogicalDrives() function Pin
Curi0us_George6-Mar-04 13:44
Curi0us_George6-Mar-04 13:44 
GeneralP.S. Pin
Curi0us_George6-Mar-04 13:49
Curi0us_George6-Mar-04 13:49 
GeneralRe: Trouble with GetLogicalDrives() function Pin
P-Rex7-Mar-04 21:45
P-Rex7-Mar-04 21:45 
GeneralCould some please post a working example Pin
MeterMan6-Mar-04 12:40
MeterMan6-Mar-04 12:40 

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.