|
post what you have did, we try to correct it.
|
|
|
|
|
here is the poriton of the code:
BOOL CUserInterfaceDlg::PlotGraph(CPoint* Points,size_t m_SizeOfArray)
{
int i;
GraphRegion->SelectObject(PenSimulation);
for (i=0;i<m_SizeOfArray;i++)
{
Draw_triangle(&Points[i]);
}
return 0;
}
void CUserInterfaceDlg::Draw_triangle(CPoint* Points)
{
GraphRegion->MoveTo(Points[0].x,Points[0].y);
GraphRegion->LineTo(Points[0].x+10,Points[0].y-10);
GraphRegion->LineTo(Points[0].x-10,Points[0].y-10);
GraphRegion->LineTo(Points[0].x,Points[0].y);
}
but problem is, let sizeofArray is 100 then 100 triangles are generating but i need to show only one tiangle at a time. as when it generates the triangle no. 8 it should not show the previous 7 triangles. how can i solve that.
|
|
|
|
|
easy to do that is draw the background every time you draw the triangle to erase the previous one, then better one is draw the previous triangle again in background colour to erase.
you may need some delay in between the nth draw, otherwise human cannot see all those plots, if your machine is fast may be user can see only the last draw. Again,
If you are putting delay, your application will not be responsive, so you may use timers or threads to plot.
|
|
|
|
|
Are you using Invalidate () before painting the new one???
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Hi everybody,
I did solve how to create Flexgrid on dialog with your help.
But now I got another problem which is I do wanna use flexgrid in my code. Created a flex grid 6.0 object on cdialog (using resources)
I have a class CMyClass:CDialog and I create the dialog using Create(IdOfDialog)
Now as far as I know I do need a CMSFlexGrid pointer, smt like this:
CMSFlexGrid* grid = GetDlgItem(FlexGridID);
grid->Clear();
and my problem is I do not have CMSFlexGrid class dunno how to include, which class I should use.....
any idea?? thank you...
|
|
|
|
|
You may have a bit of web search.
Add variable of type control to the CDialog derived class, CMyClass using Class Wizard it takes care of getting the class for you.
I know you are using VS 6.0 from previous posts, so do the following,
1) right click the Flexgrid control on the Dialog resource then select Class Wizard.
2)In the Member Variables tab Select the appropriate project name, class name CMyClass, Select the Control ID FlexGridID, and click Add Variable (button)
3) Give the name for the member variable say m_grid. Select Category as Control. Where the Variable type is automatically populated to you by class wizard as CMSFlexGrid, then OK (it will confirm to add the CMSFlexGrid in to project,.. OK).
CMSFlexGrid is served to you, go ahead.
|
|
|
|
|
thanx man...
I did see "use wizard" tips on web pages but they all said use add variable wizard and I couldn't find such a thing till now...
ok one more thing... I do have a class but i did not associate it with dialog resource. How can I associate it with an existing class, cause Select Class listbox is all empty.....
thank you for your reply..
|
|
|
|
|
which class you are talking about now, previous post said you don't have CMSFlexGrid?
Specify which class which control.
|
|
|
|
|
I mean when I use class wizard it says this dialog is not associated with a class. But I did write an header file which inherits CDialog class CLangNWords : CDialog
I want to associate my dialog with my existing class but when I select Use Existing class there's nothing in listbox I can select.
It may because of I only write h file and there's no cpp file for it.
I am asking about how to associate these to. But doesn't seem too important right now I can write it again.
Thank you for your help.
|
|
|
|
|
Its better you create a MFC class derived from CDialog using class wizard at that time itself it associated with the dialog ID, then copy any necessary code from old class to this one.
|
|
|
|
|
How to set background color of menu in vc++
|
|
|
|
|
|
It is very difficult to understand.
Any other easier way to do it?
|
|
|
|
|
|
How to change menu background color in VC++
|
|
|
|
|
Dont need to ask again.
|
|
|
|
|
Rect rt(0,10,100,20);
TextureBrush br(&bm);
g.FillRectangle(&br,rt);
|
|
|
|
|
Hi,
try using
CBrush::CreatePatternBrush.
then use
void FillRect(
LPCRECT lpRect,
CBrush* pBrush
)
tio Fill the Rectangle.
thanks
Nitheesh
|
|
|
|
|
I'm using SYSTEMTIME to get the current time, but I'm unable to get Hour because it always returns 0. Do anybody know why?
<br />
SYSTEMTIME st;<br />
GetSystemTime(&st);<br />
DWORD hours = st.wHour;<br />
DWORD minutes = st.wMinute;<br />
For example if my time now is 5:14, and it only says 0:14
|
|
|
|
|
The first thing I'd suggest is setting a breakpoint and inspecting st in the debugger. I suspect you'll find that the hour data in the SYSTEMTIME struct is correct.
My gut instinct is that you have a bug in your string formatting statement. If you'll show me the full snippet, perhaps I'll notice something that you might have overlooked.
|
|
|
|
|
Thanks for your reply. I checked the GetSystemTime description again and it doesn't return the time values according to local time so it's my fault to use that function over the GetLocalTime(). It's working now.
thanks.
|
|
|
|
|
You should use the GetLocalTime () function to get the local time. The GetSystemTime() function returns the time in UTC(Coordinated Universal Time )
|
|
|
|
|
Not sure that I was any help, but I'm glad you got it worked out. Always an adventure, ain't it?
|
|
|
|
|
nintendoWii wrote: For example if my time now is 5:14, and it only says 0:14
What timezone are you in?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Since IE7 provides tabs and yet, curiously, no tab API, I'm back in the all too familiar land of hacks and workarounds. Here's the current little jewel I'm grappling with. I navigate to a new page via IWebBrowser2::Navigate, specifying the flag to open in a new tab. This is a toolbar project, and IE actually creates a new instance for each tab.
Here's the problem. Normally, you'd check DISPID_DOCUMENTCOMPLETE and get the current url to know where you are. However, in this scenario, the url I've called with Navigate in tab 1 gets domain level redirected to a different domain / url in the destination tab 2.
What I need to know in the context of the new tab is the original url that was specified in the first tab. Unfortunately, none of the DISPID_... events I've tested allow me to determine what the original intent was before the redirect. At any point where I can get the current doc for this tab, it's already showing the domain redirect, not the original request. Given that there can be multiple tabs open, I haven't figured out any way for tab 2 to communicate with tab 1.
Any ideas on how to suss this out?
Thanks,
|
|
|
|