|
Yes, I have written that code snippet in OnPaint function only...
|
|
|
|
|
Where do you use of this code? WM_PAINT
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I have written that code snippet in OnPaint function only...
|
|
|
|
|
Does your code like this?
void CTestDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<wparam>(dc.GetSafeHdc()), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CPaintDC dc(this); // device context for painting
dc.SetROP2(R2_NOTXORPEN);
dc.MoveTo(100,100);
dc.LineTo(100,200);
dc.MoveTo(200,205);
dc.LineTo(200,305);
CDialog::OnPaint();
}
}
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hi Saadi,
Thanks for your help on this.., I am able to draw the constant line if i have opened other window on dialog box, but here in my application the line will move from left to right in between two sliders along with the slider positions.
while the line is moving, if i have opened any window on dialog box, the previous line is not getting erasing.
I thought of it is losting the previous line pixels information..
Can you please tell me how i have to achive this..?
thanks in advance..
|
|
|
|
|
Hi John
Well Im not Saadi (poet)[^].
Your answer is easy if you want to clear previous lines you can draw on it again for example you have this code:
dc.SetROP2(R2_NOTXORPEN);
dc.MoveTo(100,100);
dc.LineTo(100,200);
dc.MoveTo(200,205);
dc.LineTo(200,305);
if you use of this code again you clear previous line.
dc.SetROP2(R2_NOTXORPEN);
dc.MoveTo(100,100);
dc.LineTo(100,200);
dc.MoveTo(200,205);
dc.LineTo(200,305);
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
in which function do you try to do this?
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
In OnPaint function... , I have already done with google, but i don't get any correct help... So Could you please help me regarding this...?
|
|
|
|
|
did you debug to check if variables contain the same values as they did before other window was moved over your dialog.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
yes i have debugged, iam getting all the variables are in correct manner.
|
|
|
|
|
Windows is event driven (well, message driven...): drawing should happen inside the WM_PAINT message handler, that is CDialog::OnPaint method for an MFC application.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi All,
I'm using CStdioFile to read a file line by line, I want to delete line 5,6,9 from the file.
Plz give me hint or soln..
thax 
|
|
|
|
|
You can either write the lines to another file without writing the lines you want to delete.
Then delete the original and rename the new file with the original name.
Or you could store all the required lines in memory and overwrite the original file.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
me sathish
first take the contents of the file using FILE* like c funtions
gradually turn to next line ,meanwhile to store a static value if the pointer goes to downwards if reached 456 write " " ie empty text there ...
ya
|
|
|
|
|
sathish / satheesh,
You need to reply to the original poster, not the helper. The original poster will be more interested in your assistance.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
me carlo
go straight forward until you reach the first crossroad with traffic lights, then turn left and straight forward to the next crossroad with traffic lights where you will take the left turn and then make a turn on first available street on your right. Go straight forward down the street and at the end, on your right you'll see the hotel.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Makes perfect sense to me, although I question why you opted to turn down that one street.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
is there an easy way to hide/show nodes in a mfc ctreectrl?
i need to create a function that does this, but all i could come with is deleting and inserting a node to hide and show it.
but this would be a problem especially since i have to know the order of the nodes.
thanks
|
|
|
|
|
I think you need to delete and insert them again.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I can confirm Hamid's opinion. I've looked at the possible item states, and there isn't a TVIS_STEALTH option, or any other equivalent that I can see.
But you can always keep a copy of the information you created the tree from and work with that and add / remove the nodes from the tree.
Sorry, but I don;t see any alternative to you rolling your sleeves up and typing.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
I crreate two MFC DLL projects for 3ds max plugin.
Frist project is called maxCameraPathMFC ,which call the fDoExport function of maxCameraPathExporterMFC (second project).
int maxCameraPathMFC::DoExport(const TCHAR* name,ExpInterface* ei,Interface* i, BOOL suppressPrompts, DWORD options)
{
typedef int (CALLBACK* D_MYEXPORT)(const TCHAR*,ExpInterface*,Interface*,BOOL,DWORD);
HMODULE l_mod;
D_MYEXPORT l_export=NULL;
int l_ret=0;
l_mod=LoadLibrary("plugins_akira\\2\\maxCameraPathExporterMFC.dle");
if (l_mod!=NULL)
{
l_export=(D_MYEXPORT)GetProcAddress(l_mod,"fDoExport");
l_ret=l_export(name,ei,i,suppressPrompts,options);
FreeLibrary(l_mod);
}
return TRUE;
}
Second project is called maxCameraPathExporterMFC,which is based on KW X-port source code. The project's fDoExport function calls the IGamExporter's DoExport as below:
int __stdcall
fDoExport(const TCHAR *name,
ExpInterface *ei,
Interface *i,
BOOL suppressPrompts,
DWORD options)
{
if(!suppressPrompts)
{
{
IGameExporter* pIGameExporter=new IGameExporter();
pIGameExporter->DoExport(name,ei,i,suppressPrompts,options);
delete pIGameExporter;
}
}
return TRUE;
}
I export XFile by first project's dll, and then call the second project's fDoExport. The XFile is really exported successfully. But when I close the 3ds max, it appears an error message of Unhandle exception (http://cid-fbeb6373d9321a7f.skydrive.live.com/self.aspx/Questions/3ds%20max%20two%20%20plugin%20error%20Q2.JPG).
Colud somebody tell how to solve this probolem?
I put the complete source code at the web (http://cid-fbeb6373d9321a7f.skydrive.live.com/self.aspx/Questions/maxCameraPathQ2.rar)
|
|
|
|
|
Hello,
I am using CRecordset to access MSSQL database. I use CString to bind
the varchar datatype.
When a empty string is assigned to the CString variable and update,
the length is not correct.
The following steps can repeat the problem:
1. Assign the varchar field to "AAA"
2. Assign the CString variable to "" and then call update()
3. In Query analyzer, len() returns 3 instead of 0.
When retrieve the value and compare against '' (empty string) in ASP
code, it returns false.
Please help. Thanks.
Regards,
HM
|
|
|
|
|
Does anyone Know if there is a ON_MESSAGE macro for sending messages to Dialog box as the ON_MESSAGE looks for Cwnd *
Tnakx
|
|
|
|
|
CDialog inherits CWnd, so I don't understand your question.
Could you provide some details regarding your problem?
|
|
|
|
|
I download Popupdemo from this site after building it I got the Following compile errors
1>.\PopupDemoDlg.cpp(88) : error C2440: 'static_cast' : cannot convert from 'void (__thiscall CPopupDemoDlg::* )(void)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'
1> None of the functions with this name in scope match the target type
1>.\PopupDemoDlg.cpp(89) : error C2440: 'static_cast' : cannot convert from 'void (__thiscall CPopupDemoDlg::* )(void)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'
1> None of the functions with this name in scope match the target type
The cause of this seems to be
The Message map macro
BEGIN_MESSAGE_MAP(CPopupDemoDlg, CDialog)
//{{AFX_MSG_MAP(CPopupDemoDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_MESSAGE(ID_MENU_SELECTALL, OnSelectAll) <---
ON_MESSAGE(ID_MENU_COPY, OnCopy) <---
Point to functions OnSelectAll, and Oncopy Which are members CpopupDemoDlg which is a CDialog type
Which in a way makes sense since you do a SendMessage typically to a Cwnd not a Cdialog
was just wondering if there was a way around this error
thankx
|
|
|
|