|
|
Shouldn't that be TRUE? Here's the snippet from MSDN for WM_ERASEBKGND :
<br />
An application should return nonzero in response to WM_ERASEBKGND if it processes the message and erases the background; this indicates that no further erasing is required. If the application returns zero, the window will remain marked for erasing. (Typically, this indicates that the fErase member of the PAINTSTRUCT structure will be TRUE.)<br />
Anyway, I've handled the WM_ERASEBKGND message & returned both FALSE & TRUE but it appears that it doesn't matter - the control still flickers.
Chen Venkataraman
|
|
|
|
|
Returning FALSE follows the MSDN docs - after all, you do not erase the background just by returning FALSE from the empty handler.
BTW: Use GetClipBox with a paint DC, not with a memory DC.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
The way I always did this was to draw the control to a memory DC, THEN call CPaintDC, THEN draw the control. CPaintDC causes the area to be erased, although it is reasonable to suggest that overriding OnEraseBackground to not call the parent method would solve this also.
When you overrode WM_ERASEBACKGROUND, did you still call the base method ? If so, don't if you don't want the background erased.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Hello,
As a part of the college lab work I have to write a client and a server using MFC. The prof explained the whole stuff briefly, and I recall him having talked about threads etc. The client/server have to use the UDP protocol and be able to transfer files (even big ones).
Can someone tell me how to do this? or where I can find relevant resources? I dont know how to analyse the problem.
Thanks,
Mike
|
|
|
|
|
|
Hi, does anybody know how can I hide the main frame in a MDI app?? Tnx
|
|
|
|
|
|
|
It works for me. Are you sure you're calling ShowWindow(SW_HIDE) for main frame?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Sorry I think I made the wrong answer. It's there any way to hide the main frame, and show the child frame at the same time?
|
|
|
|
|
Because the child frame is a *child* of the main window, I believe hiding the main window will hide the child. However, if you resize the main window to 1x1 pixel and put it at -100, -100, it's very rare for the multimonitor setup to exist that will see your one pixel window. Just store the CRect the window takes up first so you can restore it.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I'm writing Client & Server program, i'm using ADO ...
If i wanna write program on the Client computer, i must add this line to my source code ?
pRecordset->CursorLocation = adUseClient;
Is that necessery ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Yes, if you are using a access Database, but if you are using a SQL Server I saw that the bookmarks and absolute positions don't works if you dont use that parameter.
Cheers!!!!
Carlos Antollini.
|
|
|
|
|
I got your mean about Access database ...
But i didn't understand your mean about SQL Server database, you mean if i uss SQL Server database, If i use CursorLocation or i don't use CursorLocation in my program, result is equal ?
Is it right ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I have a pointer to a CButton -derived object that is assigned using GetDlgItem (though I have tried using FromHandle and FromHandlePermanent ).
Any ideas why sometimes (in a release build) the m_pCtrlSite member of CCmdTarget gets set to 1? I think it should be NULL unless it is something to do with an ActiveX control, which it isn't.
This is causing my subsequent call to EnableWindow to fail because inside the CWnd calls it checks m_pCtrlSite for NULL , which it isn't if it's 1. But trying to dereference it (as in the CWnd ) casues an obvious access violation.
Derek Lakin.
Salamander Software Ltd.
|
|
|
|
|
Hi,
Could somebody solve the following serialization problem (sorry, the experts out there).
I have a pointer to an object in CMyDoc class, such as
class CMyDoc : public CDocument
{
protected:
CModel* pModel;
// ... other members go here
};
where CModel is a CObject derived class, defined as
class CModel : public CObject
{
CArray <csomeobj, csomeobj&=""> obj;
// other memebers ...
};
The CSomeObj is Cobject derived, and has one or more CString members, mixed with other types.
we call the Serialize override of obj from CModel::Serialize( CArchive& ar) in the statement
obj.Serialize(ar);
It goes fine for storing all the objects, but when loading them back, my program gets an error because it reads back a wrong CString memebers of the 'obj' object, but Other data of different type ar Ok.
I do not unerstand why ? any help, please ?
|
|
|
|
|
Use < and > instead of < and >. And post the serialization code from CYourDoc and CModel.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I am able to display a tooltip in a CScrollView initailly but when I scroll down or to the right, then the tooltips don't want to appear.
Anybody had this problem before?
Thank you
Franz Klein
|
|
|
|
|
Do you call OnPrepareDC before DPtoLP conversion during hit-testing?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
In my application i want to return a value into an edit box. i know that i have to change the value in a string type value.
So, as the value i want to return is a double i would like to use the function _ecvt.
But i have a pb with it, because if i want to return for example a number as 3.14, there is no pb, but if the value is 0.0314, the first 0 after "." is not taken.
In my code i do that:
int decimal,sign;
.
.
.
m_dlgPrice=0.0314;
strParam=_fcvt(m_dlgPrice,4,&decimal,&sign);
CString strInt=strParam.Left(decimal);
CString strDecimal =strParam.Mid(decimal); strParamFin.Format("%s.%s",strInt,strDecimal);
CEdit* Edit=(CEdit*)GetDlgItem(IDC_PRICE);
Edit->SetWindowText(strParamFin);
and in the edit box i could only see .314, so where is the pb?
thanks in advance for your help.
gerald
|
|
|
|
|
i actually don't know why you do it THIS way.. i would rather use
strParamFin.Format ("%f", m_dlgPrice);
this works great for me..if the output isn't what you're looking for (use other style specifications like %g )
hope this helps
bernahrd
"Politicians and diapers have one thing in common. They should both be changed regularly and for the same reason."
|
|
|
|
|
you were right, thanks for your help
gerald
|
|
|
|
|
... i have got a directory with many subdirs.. in most of them there is a foo.cfg file.. i would like to open now all these files..
is there any chance for me and not iterating through all the dir's with find_file???
thanks in advance
bernhard
"Politicians and diapers have one thing in common. They should both be changed regularly and for the same reason."
|
|
|
|
|
You have the attribute that inform you if the file is a directory. I don't know if you are working with MFC, but when you find a directory and if it is not dot, you need to use the find file into the directory, each time that you find a directory you need to find into it...
Good luck...;)
Carlos Antollini.
|
|
|
|