Click here to Skip to main content
15,887,267 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Fatal Error C1902 Pin
Jochen Arndt10-Oct-12 22:51
professionalJochen Arndt10-Oct-12 22:51 
GeneralRe: Fatal Error C1902 Pin
pix_programmer10-Oct-12 22:59
pix_programmer10-Oct-12 22:59 
GeneralRe: Fatal Error C1902 Pin
Jochen Arndt10-Oct-12 23:05
professionalJochen Arndt10-Oct-12 23:05 
GeneralRe: Fatal Error C1902 Pin
pix_programmer10-Oct-12 23:18
pix_programmer10-Oct-12 23:18 
GeneralRe: Fatal Error C1902 Pin
Jochen Arndt10-Oct-12 23:27
professionalJochen Arndt10-Oct-12 23:27 
GeneralRe: Fatal Error C1902 Pin
pix_programmer10-Oct-12 23:43
pix_programmer10-Oct-12 23:43 
GeneralRe: Fatal Error C1902 Pin
Jochen Arndt10-Oct-12 23:52
professionalJochen Arndt10-Oct-12 23:52 
QuestionCRichEditCtrl halt any visual updates for a sec !! Pin
sdancer7510-Oct-12 4:59
sdancer7510-Oct-12 4:59 
Hi,
I am using a CRichEditCtrl with an almost black background and white text. The problem is that when I want to print the text, the printer tries to simulate the original screen colors. In my case, I would like to print with standard black text & white background. What i am doing now, is that : Before that print start, I change the control with the standard colors and after the end of the printing I revert to the original screen colors. The code seems like the following :
C++
//hide selection
HideSelection(TRUE,FALSE);
//to view this correctly in MS Word or to any other word processor
//You should change the colors. Do the background white and the text black

//Disable the ENM_CHANGE events manually. We dont want to make the handler think that where was
//indeed an event.
SetEventMask(~ENM_CHANGE & GetEventMask());


int CurChar=CharFromPos(currentpos);
long len=GetTextLength();
SetSel(0 , len);
SetBackgroundColor(FALSE, RGB(255,255, 255));
SetColor(RGB(0,0,0));

    //--------------------------------------------------------
    //-------> Printing code here <--------------------
    //--------------------------------------------------------


SetSel(0 , len);
SetBackgroundColor(FALSE, RGB(61,61, 56));
SetColor(RGB(255,255,255));
SetSel(CurChar,CurChar);


//Re-enable the ENM_CHANGE events manually.
SetEventMask(ENM_CHANGE | GetEventMask());

//reenable selection
HideSelection(FALSE,FALSE);


The above code creates a flicker, especially if the pages to be printed are many. Is there any solution, like to halt visual updating of the CRichEditCtrl control for a specific period of time to avoid flicker ?
sdancer75

AnswerRe: CRichEditCtrl halt any visual updates for a sec !! Pin
Jochen Arndt10-Oct-12 5:39
professionalJochen Arndt10-Oct-12 5:39 
AnswerRe: CRichEditCtrl halt any visual updates for a sec !! Pin
chaau10-Oct-12 11:27
chaau10-Oct-12 11:27 
GeneralRe: CRichEditCtrl halt any visual updates for a sec !! Pin
sdancer7510-Oct-12 21:38
sdancer7510-Oct-12 21:38 
QuestionHow to get which Radio button is Checked? Pin
Fresher1610-Oct-12 2:14
Fresher1610-Oct-12 2:14 
AnswerRe: How to get which Radio button is Checked? Pin
_AnsHUMAN_ 10-Oct-12 2:29
_AnsHUMAN_ 10-Oct-12 2:29 
QuestionRe: How to get which Radio button is Checked? Pin
David Crow10-Oct-12 2:38
David Crow10-Oct-12 2:38 
AnswerRe: How to get which Radio button is Checked? Pin
«_Superman_»10-Oct-12 19:48
professional«_Superman_»10-Oct-12 19:48 
Questionfile is getting deleted Pin
sarfaraznawaz10-Oct-12 0:29
sarfaraznawaz10-Oct-12 0:29 
AnswerRe: file is getting deleted Pin
Sivaraman Dhamodharan10-Oct-12 0:33
Sivaraman Dhamodharan10-Oct-12 0:33 
GeneralRe: file is getting deleted Pin
sarfaraznawaz10-Oct-12 2:06
sarfaraznawaz10-Oct-12 2:06 
QuestionRe: file is getting deleted Pin
David Crow10-Oct-12 2:40
David Crow10-Oct-12 2:40 
AnswerRe: file is getting deleted Pin
sarfaraznawaz10-Oct-12 3:17
sarfaraznawaz10-Oct-12 3:17 
GeneralRe: file is getting deleted Pin
chaau10-Oct-12 11:32
chaau10-Oct-12 11:32 
GeneralRe: file is getting deleted Pin
sarfaraznawaz10-Oct-12 19:28
sarfaraznawaz10-Oct-12 19:28 
QuestionMenu Items Not Displaying Pin
002comp10-Oct-12 0:09
002comp10-Oct-12 0:09 
QuestionRe: Menu Items Not Displaying Pin
David Crow10-Oct-12 2:43
David Crow10-Oct-12 2:43 
AnswerRe: Menu Items Not Displaying Pin
002comp10-Oct-12 2:58
002comp10-Oct-12 2:58 

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.