RE: [Dev-C++] why doesn't this work?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: P.D. v. Z. <pd...@xs...> - 2003-02-20 12:25:14
|
In general, the only place where you should draw anything on your window
is when Windows requests you to, in WM_PAINT ... if you draw anywhere
else, there's a pretty big chance that what you painted on the screen
will get overwritten again when Windows sends a WM_PAINT (since you
don't do anything there, Windows will decide what to do).
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Carlos
Garc=EDa del Monte
Sent: Thursday, February 20, 2003 12:29 PM
To: dev-cpp-users-list
Subject: Re: [Dev-C++] why doesn't this work?
When you process the WM_CREATE, the window is not yet created, so you=20
cannot work with its hdc, at least, it is what it seems to happen. I did
an experiment like yours and didn't worked, I deleted the code and moved
to another WM_.
Vlada Djurovic wrote:
>Hi.
>This is suppposed to be simple, but I can't get it to work. All I want
to do
>is display some text using TextOut function, but I get only a blank
window.
>Here's the code:
>
> HDC hDC;
> case WM_CREATE:
> {
> char str[]=3D"Display text";
> hDC=3DGetDC(hwnd);
> TextOut(hDC,100,100,str,lstrlen(str));
> ReleaseDC(hwnd,hDC);
> }
> break;
>
>What am I doing wrong?
>------------
>Vlada
>
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
>The most comprehensive and flexible code editor you can use.
>Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
>www.slickedit.com/sourceforge
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
> =20
>
-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|