On a toolbar I am working on, the button is erased but it still responds to mouse clicks. I have already tried NOT to ANSWER the WM_ERASEBKGND; use BeginPaint-EndPaint, or GetDC-ReleaseDC instead, but the background is either erased or it is completely transparent and not drawn. Either way, the button does not show, but is active. Now, if I don't respond to WM_PAINT messages, the toolbar is correctly drawn, and the button is ok...
I am just trying to change the bkgnd/text color of a static control, created during OnCreate(). To do this, when the browser is resized and Windows sends a WM_PAINT message, I wrote the OnPaint()->BeginPaint() to change it. Exactly: There is a main toolbar which holds a static control and a button. The OnPaint() is inside the .cpp of the main toolbar. Inside the OnPaint() I try to paint the main toolbar and the static control. The static control gets painted ok, and so does the main toolbar. However, the button disappears even if I don't paint anything like:
->Result: Everything is in place, except for the button that disappears.
In sumary, what I need to do is this:
-> Create a static control to receive scrolling text feed;
-> Change the color of this text and the control's bkgnd;
-> Put an image on the toolbar;
-> Create a button that DOESN'T DISSAPEAR
Sorry if I can't explain very well, but I am more used to C programming, so talking about classes and how they are called, when there is no main function is a bit confusing for me
For instance, I do not understand very well the following piece of code:
|----- Edit Control (Child Window)
Main_Toolbar---- ----- Button
|------ Static Control (Child Window)
-> Create a toolbar with an edit box, for user input; (OK)
-> Create a button that responds to mouse click; (OK)
-> Create a static control with text; (ok)
-> Create a bitmap on the toolbar; (not ok yet, but i have not worked on it yet)
Now, how am I trying to do these:
-> Create everything inside the OnCreate(); (ok)
-> Position everything inside the OnSize(); (ok)
-> Change Static Control's Text/Bkgnd color inside OnPaint(); (NOT OK)
iam trying to do the following.
the data gets stored in a group of files. the files have to be called back or opened at a later stage to plot.
on selecting a checkbox, the default or the first file name (of say, 4 files) should be displayed in an edit bar. the edit bar goes active only on clicking the check box. the edit bar should be able to scroll through to find all the available files. the files are stored with .txt extension.
the file that gets selected gets plotted which is done by clicking another pushbutton "plot".
I cannot get the file names to be displayed in the edit bar. how do i do it?
Thanks in advance.
Need a clarification...
I have an MFC Server/Client multithreaded Application, now i'm looking to rewrite in C#.Net. It uses Oracle 9i as database. Before i jump to my development work, i need to clarify if it is a right move to write in .net when it comes to performance (server), ease of development, etc.
have an MFC Server/Client multithreaded Application, now i'm looking to rewrite in C#.Net. It uses Oracle 9i as database. Before i jump to my development work, i need to clarify if it is a right move to write in .net when it comes to performance (server), ease of development, etc.
.Net is new technology, better you switch over to it or become extinct
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
I am working on a drawing application using MFC and GDI+.
Now I am checking the following method
virtual BOOL OnDraw(CDC* pDC, CSize& rSize);
in my class derived from COleServerItem.
(This method is called to draw OLE item to metafile by framework.)
In this method, (actually pDC is pointer to CMetaFileDC object.)
is failed, as lastResult = GenericError
is failed, as lastResult = OutOfMemory
Naturally, GDI grawing using pDC is OK.
How do I manipulate pDC with GDI+?
My environment is Visual Studio 2003 Version 7.1.3091.
If anyone has any suggestions about what I am doing wrong,
it would be greatly appreciated!
virtual BOOL OnDraw(CDC* pDC, CSize& rSize);
is called by framework to draw a OLE item to a metafile.
so, CMetaFileDC object is created by framework.
According to MFC library reference "COleServerItem::OnDraw".
-- modified at 20:15 Sunday 17th September, 2006
GDI+ can record metafiles in the EMF and EMF+ formats, but not in the WMF format.
according to "Metafiles in GDI+"
But OnDraw's pDC is Windows Metafile (WMF) .
So, we cannot use GDI+ in COleServerItem::OnDraw.
Last Visit: 31-Dec-99 19:00 Last Update: 22-Jan-22 5:54