|
One way to see this is to have the compiler generate machine and assembly source (in output, depending on the compiler.) If you don't understand assembly, though, it may not do much good.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
If you are using Microsoft compiler,
Take a look its (CL.EXE) options - cl.exe /?
-PREPROCESSOR-
/AI<dir> add to assembly search path /FU<file> forced using assembly/module
/C don't strip comments /D<name>{=|#}<text> define macro
/E preprocess to stdout /EP preprocess to stdout, no #line
/P preprocess to file /Fx merge injected code to file
/FI<file> name forced include file /U<name> remove predefined macro
/u remove all predefined macros /I<dir> add to include search path
/X ignore "standard places"
|
|
|
|
|
|
rrc.
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]
|
|
|
|
|
A simple linked list. Do something with the first, then move the first to the end (don't forget to update the pointers). Repeat to achieve round robin. Three words aren't going to get you any code - be specific and understand that this is not RentACoder; chances are you'll get helpful hints, not complete solutions
|
|
|
|
|
rainbow trout
"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
|
|
|
|
|
How to let an SDI-Appliction automatically scroll to present the last line of very long text in the output?the class used hier is CEditView.
|
|
|
|
|
Use CEditView::GetEditCtrl to get a reference to the edit control in the form of a CEdit class instance. Then you will need CEdit::GetLineCount , CEdit::LineScroll and CEdit::SetSel to perform the actual scrolling.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hallo and thanks for the reply , i have this code in the Tes_Doc.cpp
CEdit &EditOutput = m_ptrOutput->GetEditCtrl ();// m_ptrOutput is CEditView Pointer
nLineCount = EditOutput.GetLineCount ();
EditOutput.LineScroll (nLineCount);
DWORD dwSel = EditOutput.GetSel();
EditOutput.SetSel (dwSel,true);
EditOutput.SetWindowTextA(m_strOutput);
The code does not work. I do not know why?
|
|
|
|
|
Try this sequence.
CEdit &EditOutput = m_ptrOutput->GetEditCtrl();
EditOutput.SetWindowTextA(m_strOutput);
LineCount = EditOutput.GetLineCount();
EditOutput.LineScroll (nLineCount);
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
it works thank you very much.
|
|
|
|
|
I have a program that uses MFC Dialog, GDI and DirectDraw to bounce a ball around a screen.
I have got it all working with 3 standard timers set at 1 ms 50 ms 1000 ms and a high performance timer.
I am using GDI to double buffer and bitblt and i am trying to use Directdraw to take this and avoid tearing by waiting for the vertical refresh.
My trouble is that as soon as you click on the screen it stops, It seems to be accessing the desktop somehow with the mouse.
Anyone got any ideas
www.rosspctraining.co.uk/timer8.zip
a working GDI only version is
www.rosspctraining.co.uk/timer9.zip
|
|
|
|
|
The WRR algorithm is based on the Round Robin
algorithm but it takes into account the processing
capacity of each waiter.
• The administrators manually assign a coefficient of
performance to each waiter. ( 1, 2 and 3 in the example).
Counter
Reset
VCC 1 (Source 1) 1 1 1 Cycle
VCC 2 (Source 2) 2 2
VCC 3 (Source 3) 3 3 3 3 3
2
1
3
3 3 1 3 2 1 3 3 1 3 2 1
WRR
scheduler
Coefficients of performance
….
• A sequence of scheduling is generated automatically
according to this value.
• The requests are then assigned to the various
waiters according to a sequence of alternate
repetition
VCC 2 (Source 2)
VCC 3 (Source 3)
VCC 1 (Source 1) 1 1 1
2 2
3 3 3 3 3
2
1
3
3 3 1 3 2 1 3 3 1 3 2 1
WRR
scheduler
Counter
Reset
Cycle
Sequence of scheduling
…….
WRR
|
|
|
|
|
Read the Guidelines[^] and post accordingly. Reposting the same thing several times will get you ignored RightAwayTM
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
samar aladwan wrote: The WRR algorithm is based on the Round Robin
algorithm but it takes into account the processing
capacity of each waiter
Thank you for the precious info. Now you might go back to your homework.
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]
|
|
|
|
|
Round-Robin algorithm equitably distributes
the load between each waiter whatever the
current number of connections or the response
times
RR
• This algorithm is adapted if the waiters of the
cluster have the same processing capacities
• if not, certain waiters are likely to receive
more requests than they can treat. Some
while others will use only part of their
resources.
• The WRR algorithm solves this problem.
|
|
|
|
|
you should really do your own homework
|
|
|
|
|
I have this peace of code to choose a font family for the input text in ceditview class(i have here SDI_Appliction):
CFont *cfont = (CFont*) new CFont();
LOGFONT *lf = new LOGFONT();
m_cfdlg.GetCurrentFont(lf); // CFontDialog m_cfdlg;
strFaceName = m_cfdlg.GetFaceName();
nSize = (m_cfdlg.GetSize()/ 6);
cfont->CreateFont(nSize,lf->lfWidth,lf->lfEscapement,lf->lfOrientation,lf->lfWeight,lf->lfItalic,false,
0,1,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS,strFaceName);
CEditView m_ptrInput = (CEditView *) m_wndSplitter.GetPane(0,0);
ASSERT_VALID(m_ptrInput);
m_ptrInput->SetFont(cfont,true); // When this line apllied, the Text will have the size that benn choosen in the font dialog but not the font family or the face name ???
Any help would be appreciated.Thanks
|
|
|
|
|
Hello ,
My application needs to monitor all other running applications on the system. Is there some way I could get notified on exit of every application exe?
The methods I could find:
1) Use PSAPI functions to get the list of running exes at frequent intervals. At each poll compare with the previous list to find which application/process has exited.
Disadvantage: Requires constant polling, will take CPU time.
2) Set a global hook for WM_CLOSE message: Using this I would be able to get a notification when any application gets closed through the close button on the title bar
Disadvantage:
(-) Not all the applications are generating a WM_CLOSE message (Ex: Total Video Player Exe)
(-) If the application was closed through the "Exit" menu or button (e.g. File->Exit) , I can't trap that message
Is there any other better way that I missed? Please advise.
|
|
|
|
|
WindowsPistha wrote: Not all the applications are generating a WM_CLOSE message (Ex: Total Video Player Exe)
(-) If the application was closed through the "Exit" menu or button (e.g. File->Exit) , I can't trap that message
Why don't you capture WM_QUIT instead? This is the only message that finally halts the Message Loop.
But, you won't be able to track abnormal termination of an application with this.
|
|
|
|
|
Taran9 wrote: Why don't you capture WM_QUIT instead? This is the only message that finally halts the Message Loop.
But, you won't be able to track abnormal termination of an application with this.
But our application needs to handle that case too.
|
|
|
|
|
You will need to hook APIs like TerminateProcess in addition to installing a message hook.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Just out of curiousity, what kind of an application are you writing?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
3) Use WMI, as shown in this message[^]. The sample code is VBScript (and would need to be rewritten as below), but it works well enough.
' Get a reference to the WMI service
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
' Open a WMI query for __instancedeletionevents where the target instance is a Win32_Process
Set colMonitoredProcesses = objWMIService. _
ExecNotificationQuery("select * from __instancedeletionevent " & _
"within 1 where TargetInstance isa 'Win32_Process'")
' This call will complete the next time a process is deleted.
colMonitoredProcesses.NextEvent
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Stuart Dootson wrote: 3) Use WMI, as shown in this message[^]. The sample code is VBScript (and would need to be rewritten as below), but it works well enough.
Does this required WMI service running in the machine.
If it is turned off , will i able to catch this event "__InstanceCreationEvent"
Thanks
|
|
|
|