|
I got error LNK2001 When I tried that I didn't Lea since the pointer had the address all I had to do was a mov instruction
|
|
|
|
|
I'm creating a backup program, and I need to be able to open files with the ACCESS_SYSTEM_SECURITY privilege.
However, when I specify this privilege in my call to CreateFile, it tells me I'm missing a "required privilege" even when I run it as Admin.
This is on Vista.
What are the steps for getting the required privilege to open files with this access right?
“Cannot find REALITY.SYS...Universe Halted.”
~ God on phone with Microsoft Customer Support
|
|
|
|
|
hi
i have created adialog based application.but i just found out recently that it is hard to link a database to adialog("such as displaying results in an edit box ")
Is it really that difficult??
and can some one tell me how to do it???
please i really need it ("its for my project and i will reach my time limit soon ")
please >>>any help will be appreciated.
thank u in advance
Lahom
|
|
|
|
|
Did you search on the codeproject?
|
|
|
|
|
Hi,
I wanna know how could i drew a few cercles just by typing with lines of code. I'm under MFC on MSVS 6.0. is there some struct that could help me to drew such shapes?
hope that i wrote right
And thank you.
"The Ultimate Limit Is Only Your Imagination."
modified on Sunday, April 6, 2008 4:21 PM
|
|
|
|
|
Do you mean something like this?
void CMyWnd::OnPaint()
{
CPaintDC dc(this);
dc.Ellipse(10, 10, 50, 50);
}
Or do you want to write the circle drawing code yourself? If so, Google "circle drawing algorithm".
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Ok so let's say that i wanna drew 3 cercles on my formview, so shoulf i write that code 3 times with different values?
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
did ever heard about loops?
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
|
|
|
|
|
CPallini wrote: did ever heard about loops?
These?[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Exactly.
BTW turn off your CPMRU , it is not fair using such device for this kind of guess.
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
|
|
|
|
|
lol, I know about loops but the prob that i dont know how many circles that the user wanna, let say 2O so how could i declare the 20 vars for those cercles
for (i=0 ; i< 20; i++)
{
Cercle[i].....??
}
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
You could store the coordinates in an array.
An array container that grows automatically would be even better, like a vector or a CArray.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
yup i'm using a vector
but is the form "Formview" suitable for drawing or should i select another type?
i'm new on drawing :s
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
Ok I'tested on a FormView and it works i had a white circle it was a stupid querstion
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
You can draw on any window.
A CFormView is useful when you have controls you need to layout on the window like a dialog window.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You don't necessarily have to write the code three times.
However you write the code, it must call Ellipse() three times.
These are two equivalent examples:
void CMyWnd::OnPaint()
{
CPaintDC dc(this);
dc.Ellipse(10, 10, 50, 50);
dc.Ellipse(30, 30, 70, 70);
dc.Ellipse(50, 50, 90, 90);
}
void CMyWnd::OnPaint()
{
CPaintDC dc(this);
CRect CircleRect(10, 10, 50, 50);
for (int i = 0; i < 3; i++)
{
dc.Ellipse(&CircleRect);
CircleRect.OffsetRect(20, 20);
}
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
when i click on the butoon nothing is drawin !!!
is it a prob of reference to the dc .?
<br />
void CSecondForm::OnButton1() <br />
{<br />
<br />
CPaintDC dc(this);<br />
dc.Ellipse(20, 20, 100, 100);<br />
}<br />
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
You can only use a CPaintDC when responding to a WM_PAINT message (in OnPaint()).
Use a CClientDC in your button click handler instead...
void CSecondForm::OnButton1() <br />
{<br />
<br />
CClientDC dc(this);<br />
dc.Ellipse(20, 20, 100, 100);<br />
}
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank you It works now.
but a last question ? how could i write a text into the cercle like "Cercle1" etc..
ANd thank you for your help.
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
You'll need to select a font into the DC (unless you want to use the default font), then you can use any of the
GDI text rendering functions (CDC::DrawText[Ex](), CDC::TextOut(), CDC::ExtTextOut(), etc.) to draw the text.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
<br />
void CSecondForm::OnButton1() <br />
{<br />
<br />
CClientDC dc(this); <br />
dc.Ellipse(10, 10, 70, 70);<br />
dc.Ellipse(20, 20, 70, 70);<br />
dc.Ellipse(30, 30, 70, 70);<br />
dc.Ellipse(40, 40, 70, 70);<br />
CString str;<br />
str="Cercle";<br />
CDC::TextOut(100,100,str);<br />
}<br />
CDC::TextOutA' : illegal call of non-static member function
i atried even with CDC::TextOut(100,100,"Cercle");
Same prob
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
I found it, srry for the multipost.
void CSecondForm::OnButton1()
{
// TODO: Add your control notification handler code here
CClientDC dc(this);
dc.Ellipse(10, 10, 70, 70);
dc.Ellipse(20, 20, 70, 70);
dc.Ellipse(30, 30, 70, 70);
dc.Ellipse(40, 40, 70, 70);
CString str;
str="Cercle";
dc.TextOut(100,100,str);
}
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
You got it
I notated it that way ("CDC::") to show what class the methods were in - the CDC class.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
yup ou are all reason
Thank you ppl.
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|