Click here to Skip to main content
15,914,016 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Modifying date Pin
Weiye Chen30-May-05 18:23
Weiye Chen30-May-05 18:23 
GeneralRe: Modifying date Pin
ThatsAlok30-May-05 18:43
ThatsAlok30-May-05 18:43 
GeneralRe: Modifying date Pin
Neville Franks29-May-05 23:59
Neville Franks29-May-05 23:59 
GeneralRe: Modifying date Pin
Toni7830-May-05 10:51
Toni7830-May-05 10:51 
GeneralCommand line input with assembly Pin
Cpudood29-May-05 14:46
Cpudood29-May-05 14:46 
GeneralRe: Command line input with assembly Pin
Toni7829-May-05 15:51
Toni7829-May-05 15:51 
Generalmy systray clock color changer code do not work and it crashes Pin
ELY M.29-May-05 13:59
ELY M.29-May-05 13:59 
GeneralRe: my systray clock color changer code do not work and it crashes Pin
Christian Graus29-May-05 14:20
protectorChristian Graus29-May-05 14:20 
I put this code in a project and compiled it. Do you ignore warnings, or are they turned off ?

HDC hdcClock;


COLORREF col;
HDC hdc;
char s[1024];

if(hdcClock) DeleteDC(hdcClock); hdcClock = NULL;

You do not set hdcClock to NULL when you create it, and you never set it to anything else before trying to delete it. It's not NULL, and so it will try to delete it, but it won't point to anything valid.

int nblink;
RECT *prc;

if(nblink == 0 || (nblink % 2)) col = RGB(255,255,0);

nblink, same problem.

RECT *prc;

if(nblink == 0 || (nblink % 2)) col = RGB(255,255,0);
else col = RGB(255,0,0);
//if(col & 0x80000000) col = GetSysColor(col & 0x00ffffff);
//SetBkMode(hdc, OPAQUE);
//SetBkColor(hdc, col);

hbr = CreateSolidBrush(col);
FillRect(hdc, prc, hbr);

same problem - prc.

NEVER create a variable without initialising it's value. And goodness knows what half this code was trying to do, I assume you found an online sample and deleted half the code ?

Also, you should step through the debugger first, before asking for help. If you do that, you may solve the problem and you'll at least be able to tell us the line that blows up, and the error you get ( actually, you should have been able to tell us the error anyhow ).

Christian Graus - Microsoft MVP - C++
Generalhelp me !!(about multy thread using csocket) Pin
NPDemon29-May-05 5:19
NPDemon29-May-05 5:19 
GeneralRe: help me !!(about multy thread using csocket) Pin
John M. Drescher29-May-05 14:34
John M. Drescher29-May-05 14:34 
GeneralRe: help me !!(about multy thread using csocket) Pin
NPDemon29-May-05 15:33
NPDemon29-May-05 15:33 
GeneralRe: help me !!(about multy thread using csocket) Pin
trelliot29-May-05 16:57
trelliot29-May-05 16:57 
GeneralRe: help me !!(about multy thread using csocket) Pin
NPDemon29-May-05 20:40
NPDemon29-May-05 20:40 
GeneralCDC and transparent blitting Pin
Cedric Moonen29-May-05 4:06
Cedric Moonen29-May-05 4:06 
GeneralRe: CDC and transparent blitting Pin
Chris Losinger29-May-05 5:28
professionalChris Losinger29-May-05 5:28 
GeneralRe: CDC and transparent blitting Pin
Michael Dunn29-May-05 5:35
sitebuilderMichael Dunn29-May-05 5:35 
GeneralRe: CDC and transparent blitting Pin
Cedric Moonen29-May-05 5:44
Cedric Moonen29-May-05 5:44 
GeneralRe: CDC and transparent blitting Pin
Christian Graus29-May-05 12:05
protectorChristian Graus29-May-05 12:05 
GeneralRe: CDC and transparent blitting Pin
Cedric Moonen29-May-05 20:05
Cedric Moonen29-May-05 20:05 
GeneralRe: CDC and transparent blitting Pin
John R. Shaw30-May-05 14:27
John R. Shaw30-May-05 14:27 
Generaldata not accepted Pin
anup nambiar29-May-05 4:04
anup nambiar29-May-05 4:04 
GeneralRe: data not accepted Pin
Christian Graus29-May-05 12:11
protectorChristian Graus29-May-05 12:11 
GeneralRe: data not accepted Pin
trelliot29-May-05 14:29
trelliot29-May-05 14:29 
GeneralRe: data not accepted Pin
anup nambiar29-May-05 20:41
anup nambiar29-May-05 20:41 
GeneralRe: data not accepted Pin
trelliot29-May-05 16:37
trelliot29-May-05 16:37 

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.