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

C / C++ / MFC

 
Question[Message Deleted] Pin
erfi14-Jun-06 7:48
erfi14-Jun-06 7:48 
QuestionRe: data base creating Pin
David Crow14-Jun-06 7:52
David Crow14-Jun-06 7:52 
AnswerRe: data base creating Pin
erfi14-Jun-06 7:59
erfi14-Jun-06 7:59 
GeneralRe: data base creating Pin
David Crow14-Jun-06 8:15
David Crow14-Jun-06 8:15 
AnswerRe: data base creating Pin
Hamid_RT14-Jun-06 19:10
Hamid_RT14-Jun-06 19:10 
QuestionSearch for help about Msn robot! Pin
onlysaint14-Jun-06 7:39
onlysaint14-Jun-06 7:39 
AnswerRe: Search for help about Msn robot! Pin
Blake Miller14-Jun-06 12:15
Blake Miller14-Jun-06 12:15 
Questioncolor new Pin
sidkraft14-Jun-06 7:27
sidkraft14-Jun-06 7:27 
I am trying to create a color fill that will change relative to a new value being input from the "OnHScroll" function. When I input a new value for the red color variable in the RGB function and re-display, the color never changes to the new value. See code segment below. How do I change?
...
...

int a=0,b=190,c=230,x;
CMainFrame::CMainFrame()
{
//Set color frame
colorbar.CreateSolidBrush(RGB (a, b, c));
};
void CMainFrame::OnPaint()
{
CPaintDC dc(this);
dc.TextOut (5,40,"Red Color Is:");
//Output color frame
colorbar.DeleteObject();
colorbar.CreateSolidBrush(RGB(a,b,c));
dc.SelectObject(colorbar);
CRect rc(100,150,150,200);
dc.Rectangle (&rc);
}
void CMainFrame::OnHScroll(UINT nSBCode, UINT nPos, CWnd* pCtrl)
{
//Convert pointer to slider pointer
CSliderCtrl *pSld;
pSld = (CSliderCtrl*)pCtrl;
//Get new position
x = pSld->GetPos();
a = x;
CString s; s.Format("%d",x);
//Output value for red
stcred.SetWindowText(s);
}
Note that:
1.) Initialize the colorbar to have values RGB(a,b,c)
2.) Variable "a" read in from the "OnHScroll" function and set to a new value.
3.) "OnPaint" deletes the old colorbar and re-creates with new "a" variable value, should display as output with the new color but doesn't, still displays as original a,b,c values. Please advise, Sid kraft sid_kraft@msn.com Thanks in advance, Sid Kraft.

Sid
AnswerRe: color new Pin
Laxman Auti14-Jun-06 18:38
Laxman Auti14-Jun-06 18:38 
QuestionCComSafeArray Pin
pierre_ribery14-Jun-06 7:16
pierre_ribery14-Jun-06 7:16 
AnswerRe: CComSafeArray Pin
JonEngle14-Jun-06 9:18
JonEngle14-Jun-06 9:18 
GeneralRe: CComSafeArray Pin
pierre_ribery14-Jun-06 10:28
pierre_ribery14-Jun-06 10:28 
GeneralRe: CComSafeArray Pin
JonEngle14-Jun-06 10:59
JonEngle14-Jun-06 10:59 
GeneralRe: CComSafeArray Pin
pierre_ribery14-Jun-06 11:13
pierre_ribery14-Jun-06 11:13 
GeneralRe: CComSafeArray Pin
JonEngle14-Jun-06 11:50
JonEngle14-Jun-06 11:50 
GeneralRe: CComSafeArray Pin
pierre_ribery14-Jun-06 22:16
pierre_ribery14-Jun-06 22:16 
GeneralRe: CComSafeArray Pin
pierre_ribery3-Jul-06 1:29
pierre_ribery3-Jul-06 1:29 
QuestionDirectShow BITMAP Pin
TBA_SST14-Jun-06 7:05
TBA_SST14-Jun-06 7:05 
AnswerRe: DirectShow BITMAP Pin
James R. Twine14-Jun-06 7:11
James R. Twine14-Jun-06 7:11 
AnswerRe: DirectShow BITMAP Pin
Justin Tay14-Jun-06 8:31
Justin Tay14-Jun-06 8:31 
QuestionSend xy plot by email Pin
BambooMoon14-Jun-06 6:30
BambooMoon14-Jun-06 6:30 
AnswerRe: Send xy plot by email Pin
Chris Losinger14-Jun-06 6:58
professionalChris Losinger14-Jun-06 6:58 
AnswerRe: Send xy plot by email Pin
James R. Twine14-Jun-06 7:07
James R. Twine14-Jun-06 7:07 
QuestionRe: Send xy plot by email Pin
Jun Du14-Jun-06 7:41
Jun Du14-Jun-06 7:41 
QuestionWriteConsole() pointer problem Pin
CoffeeAddict1914-Jun-06 6:27
CoffeeAddict1914-Jun-06 6:27 

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.