|
guys,
i get some porblem. i degine a graph region and i have drawn some grids with the following codes.
BOOL CUserInterfaceDlg::PlotGrid(void)
{
int i;
GraphRegion->SelectObject(Brush);
GraphRegion->SelectObject(PenGrid);
GraphRegion->FillRect(&GraphRect,&Brush);
for (i=1;i<(GraphRect.Width()/2);i++)
{
GraphRegion->MoveTo(i*((double)GraphRect.Width()/30),0);
GraphRegion->LineTo(i*((double)GraphRect.Width()/30),GraphRect.Height());
}
for (i = 1;i<(GraphRect.Height()/2);i++)
{
GraphRegion->MoveTo(0,GraphRect.Height()-i*((double)GraphRect.Height()/30));
GraphRegion->LineTo(GraphRect.Width(),GraphRect.Height()-i*((double)GraphRect.Height()/30));
}
return 0;
}
then i tried to draw another line on the grid by the following codes:
BOOL CUserInterfaceDlg::PlotRunWay(void)
{
UpdateData(TRUE);
GraphRegion->SelectObject(PenRunWay);
RXArray[0]=m_AirXPisition;
RYArray[0]=m_AirYPosition;
RPoints[0].x=RXArray[0];
RPoints[0].y=RYArray[0];
RPoints[1].x=RPoints[0].x+30000;
RPoints[1].y=RPoints[0].y+200;
GraphRegion->MoveTo(RPoints[0]);
GraphRegion->LineTo(RPoints[1]);
return 0;
}
but this is not working. it just drawing the grid lines. can anyone tell me why it happening.
thanking you all,
shohel
|
|
|
|
|
shohel899 wrote:
BOOL CUserInterfaceDlg::PlotRunWay(void)
{
UpdateData(TRUE);
GraphRegion->SelectObject(PenRunWay);
RXArray[0]=m_AirXPisition ;
RYArray[0]=m_AirYPosition;
....
....
Is that typo only here? Or in your programm too? (It looks like you copy-pasted the code snippet so check it in your app)
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
|
|
|
|
|
how i can compare between tow programs (symantc)?
if there is any code(reuseable) help me ..
please
|
|
|
|
|
Please give your messages an appropriate title. This is the second time you have used "please help me." Read the forum guidelines for further information.
|
|
|
|
|
|
two simple program
i want compare between these two programs (in syntx and semantic)
in syntx ok easy
but in symantic , i don't know what can i do?
is there standard codes in this topic can help me?
thank you very much
|
|
|
|
|
Please see point no. 2 and 3 in this[^] post.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
sofia_111 wrote: how i can compare between tow programs (symantc)?
Reminds me of the signature:
There are 10 kinds of people in the world: those that understand binary, and those that don't.
"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
|
|
|
|
|
hi ,
pls suggest me "THE BEST " book for mastering
i)c
ii)c++
thanks
|
|
|
|
|
|
Sorry,
I am sure I should stated how I declared my variables (just a quick finger)
char *my_ptr;
char *my_ptr1;
CONTEXT c;
I tried defining the variables both locally whitin the function and globally outside of the function with the same result
thankx again
|
|
|
|
|
ForNow wrote: I am sure I should stated how I declared my variables (just a quick finger)
do you know the modify option for your previous message.
|
|
|
|
|
I just looked at the previous message don't see any way to modify/edit it once it has been sent
|
|
|
|
|
Hi,
Dont know why but the Visual C compiler is not generating any code for the following
using Visual Studio 2008 Pro
c.ContextFlags = (CONTEXT_FULL | CONTEXT_CONTROL); <-- no code
GetThreadContext(hThread,&c);
my_ptr = c.SegFs; // Fs pointst to TEB <-- No code
my_ptr = my_ptr + 0x2c; // point to ThreadArray sotrage
(DWORD)my_ptr1 = *my_ptr; // point to first slot <-- No code
I move the code to some other soruce/DLL and did generate code for the statements in question
I tempted to go into _asm mode
thankx
|
|
|
|
|
ForNow wrote: is not generating any code for the following
just curious how do you verified. For Release mode I Assume.
ForNow wrote: (DWORD)my_ptr1 = *my_ptr; // point to first slot <-- No code
Unreference variable my_ptr1, no use generating code. And just curious how do you able to compiled that statement.
ForNow wrote: c.ContextFlags = (CONTEXT_FULL | CONTEXT_CONTROL); <-- no code
constant data, try assigning variable data.
ForNow wrote: my_ptr = c.SegFs; // Fs pointst to TEB <-- No code
my_ptr = my_ptr + 0x2c; // point to ThreadArray sotrage
(DWORD)my_ptr1 = *my_ptr; // point to first slot <-- No code
compiler optimises to use (address of c + SegFs member offset + 0x2c). I think it is safe to use this without asm.
modified on Monday, May 19, 2008 3:50 AM
|
|
|
|
|
Thankx
thats it just ran Debug mode and it worked
|
|
|
|
|
Your final build should be release configured, i mean that code is safe in release build also, the compiler generates optimised code, it is still safe to run. what is the problem you face in release mode although the variable assignment is skipped in the optimised code.
if you want to disable optimisation for a region of code, use,
#pragma optimize( "", off )
.
.
.
#pragma optimize( "", on )
|
|
|
|
|
|
I'm using Visual C++ 6.0 MFC with SDI
I don't understand how to make the initial window size of my program equal to the full screen size instead of the smaller window that comes up.
Thanks ahead of time.
|
|
|
|
|
Look into the MyApp.cpp at the end of the function InitInstance
pMainFrame->ShowWindow(m_nCmdShow <code>| SW_SHOWMAXIMIZED</code>);
pMainFrame->UpdateWindow();
return TRUE;
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
|
|
|
|
|
Nelek wrote: pMainFrame->ShowWindow(m_nCmdShow | SW_SHOWMAXIMIZED);
m_nCmdShow can not be ORe'd . It should be a single value.
Please refer here[^] for more information.
Regards,
Paresh.
|
|
|
|
|
From the link you gave me:
<br />
the first time ShowWindow is called, the value should be the value obtained by the WinMain function in its nCmdShow parameter. <br />
In subsequent calls, this parameter can be one of the following values. <br />
SW_FORCEMINIMIZE<br />
Windows 2000/XP: Minimizes a window, even if the thread that owns the window is not responding. <br />
This flag should only be used when minimizing windows from a different thread.<br />
SW_HIDE<br />
..<br />
..<br />
..<br />
So this InitInstance is the first time it is called so it should be not replaced or overwritten because the WinMain function sets the nCmdShow. And I don't want to make it other, I just want to add the Maximized flag.
By the way, I already tried pMainFrame->ShowWindow(SW_SHOWMAXIMIZED); and it was not working for me, more than 3 hours searching for examples and infos in MSDN and the web. So I guess that:
m_nCmdShow = SW_SHOWMAXIMIZED;
pMainFrame->ShowWindow (m_nCmdShow);
is going to have the same problems.
I am not saying that you are not right, but as I used it... works as well.
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
modified on Tuesday, May 20, 2008 4:46 PM
|
|
|
|
|
By the way... the downvoting was not mine.
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
|
|
|
|
|
You can set Maximize when you want make your project.
|
|
|
|
|
Hi Please refer below sample code,
BOOL CMyApp::InitInstance()
{
.....
m_nCmdShow = SW_SHOWMAXIMIZED;
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
.....
}
Regards,
Paresh.
|
|
|
|