Click here to Skip to main content
15,895,142 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionIncrease OS's maximum thread count? Pin
Todd Smith16-Jan-06 7:51
Todd Smith16-Jan-06 7:51 
AnswerRe: Increase OS's maximum thread count? Pin
Nish Nishant16-Jan-06 8:41
sitebuilderNish Nishant16-Jan-06 8:41 
GeneralRe: Increase OS's maximum thread count? Pin
Todd Smith16-Jan-06 8:54
Todd Smith16-Jan-06 8:54 
GeneralRe: Increase OS's maximum thread count? Pin
Nish Nishant16-Jan-06 8:57
sitebuilderNish Nishant16-Jan-06 8:57 
AnswerRe: Increase OS's maximum thread count? Pin
Stephen Hewitt16-Jan-06 11:49
Stephen Hewitt16-Jan-06 11:49 
GeneralRe: Increase OS's maximum thread count? Pin
Nish Nishant16-Jan-06 12:00
sitebuilderNish Nishant16-Jan-06 12:00 
GeneralRe: Increase OS's maximum thread count? Pin
Stephen Hewitt16-Jan-06 12:08
Stephen Hewitt16-Jan-06 12:08 
QuestionPreventing change of key fields in CRecordView? Pin
Anders Gustafsson16-Jan-06 7:42
Anders Gustafsson16-Jan-06 7:42 
Hi!

I have this software package I am maintaining and I have run into a small glitch because of the way CRecordView handles moves.

Imagine an entry window where you enter and update people. The key is an integer. If you enter a number in the key field the corresponding person is displayed. Now assume that you have a person on-screen and then change the number, but instead of leaving the field (which would trigger a lookup) you hit "PreviousRecord". This triggers an OnMove and that will do a save before the move and presto! You have changed the number of that person which was probably not what you intended.

The workaround which I have dreamed up on sleepless nights is to add a boolean to the class that all fields inherit from and check that in DoDataExchange, ie the field is normally FALSE, but TRUE for key fields.

In the DDX function I check if(pField->m_bKeyField && pDX->m_bSaveAndValidate) and only allow the DDX if m_bAddMode is true. For non-key fields I just do the DDX.

This will prevent updating the key field unless we are adding a new record.

How does this sound? Totally bad? Is there a better way?
QuestionRe: Preventing change of key fields in CRecordView? Pin
David Crow16-Jan-06 10:19
David Crow16-Jan-06 10:19 
AnswerRe: Preventing change of key fields in CRecordView? Pin
Anders Gustafsson16-Jan-06 20:23
Anders Gustafsson16-Jan-06 20:23 
GeneralRe: Preventing change of key fields in CRecordView? Pin
David Crow17-Jan-06 3:37
David Crow17-Jan-06 3:37 
GeneralRe: Preventing change of key fields in CRecordView? Pin
Anders Gustafsson17-Jan-06 4:52
Anders Gustafsson17-Jan-06 4:52 
GeneralRe: Preventing change of key fields in CRecordView? Pin
David Crow17-Jan-06 7:49
David Crow17-Jan-06 7:49 
GeneralRe: Preventing change of key fields in CRecordView? Pin
Anders Gustafsson17-Jan-06 8:49
Anders Gustafsson17-Jan-06 8:49 
GeneralRe: Preventing change of key fields in CRecordView? Pin
David Crow17-Jan-06 8:53
David Crow17-Jan-06 8:53 
GeneralRe: Preventing change of key fields in CRecordView? Pin
Anders Gustafsson17-Jan-06 9:06
Anders Gustafsson17-Jan-06 9:06 
AnswerRe: Preventing change of key fields in CRecordView? Pin
Phil J Pearson17-Jan-06 2:55
Phil J Pearson17-Jan-06 2:55 
GeneralRe: Preventing change of key fields in CRecordView? Pin
Anders Gustafsson17-Jan-06 3:02
Anders Gustafsson17-Jan-06 3:02 
GeneralRe: Preventing change of key fields in CRecordView? Pin
Phil J Pearson17-Jan-06 6:25
Phil J Pearson17-Jan-06 6:25 
GeneralRe: Preventing change of key fields in CRecordView? Pin
Anders Gustafsson17-Jan-06 7:09
Anders Gustafsson17-Jan-06 7:09 
QuestionHow do I get font width and height in pixels ? Pin
udiraz16-Jan-06 7:40
udiraz16-Jan-06 7:40 
AnswerRe: How do I get font width and height in pixels ? Pin
basementman16-Jan-06 7:47
basementman16-Jan-06 7:47 
GeneralRe: How do I get font width and height in pixels ? Pin
udiraz17-Jan-06 22:35
udiraz17-Jan-06 22:35 
GeneralRe: How do I get font width and height in pixels ? Pin
basementman18-Jan-06 4:11
basementman18-Jan-06 4:11 
GeneralRe: How do I get font width and height in pixels ? Pin
udiraz18-Jan-06 23:11
udiraz18-Jan-06 23:11 

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.