1. Conceptual Problem with Monitor.Enter and Monitor.Exit - CSharp/C#
2. why use Monitor.Enter...Monitor.Exit insted of lock(object9
Hi! If I want to lock a section in the code from concurrency item problems I can use the static Monitor class in this way Monitor:Enter ... Monitor.Exit I can also use the C# lock keyword to lock the same section. So I don't see any point at all to use the Monitor.Enter... Monitor.Exit instead of the lock keword just to lock a section in the code because of two reasons. 1. It much less to write lock then the other 2. The most importand it that you get the try..finally for free which mean that you will always free the lock in case of running into same kind of exception Is this correct understood ? //Tony
3. Need to display 4 VCL Forms in 4 diferent monitors (one form per monitor) - Delphi third-party tools
4. Monitor Size Vs Monitor resolution Vs FORMS
Hello all, I developed a simple application in a 17 inch monitor with a resolution of 1280x768; When i run the same application in a 14 inch monitor with a resolution of 1024x768, my form in the right side is truncated. I have set the following properties; Anchors-left, top Autoscroll-true Autosize size-true Align-alNone Can you please advise me, how i can solve this problem. Many Thanks Raj
5. 2 monitors - IDE won't maximise in large monitor - C++ Builder IDE
6. Put variables into member variables or function variables?
I modify my code into following sample code.
CTest is a class only constructed once when the device power on.
CTest::ExecuteRunState is a function entered periodically.
Do you think whether it is necessary to put the local variables into
class private members?
Otherwise, each time entering the ExecuteRunState(), those local
variables will be decleared and initionalized one time. It's a waste
of cpu resource.
class CTest
{
public:
CTest();
~CTest();
private:
void CTest(const CTest & m_CTest);
void ExecuteRunState(); //This function will entered periodically
};
void CTest::ExecuteRunState()
{
tMV measurement = 0;
tMVq quality = 0;
tMVt timeStamp = 0;
//Here those three variables will gain the newest values.
pData->GetNewestValue(&measurement, &quality, &timeStamp);
CalFreq(&measurement);
}
7. static variables (class variables) - Delphi/Pascal
8. ?? [Warning]...: For loop control variable must be simple local variable
I do not understand why this message: [Warning] ... : For loop control variable must be simple local variable is reported in this case (D6): unit blabla ... var k : integer; initialization for k:=0 to 5 do keyTrend[k]:=ThtmlSingleTrend.create; finalization for k:=5 downto 0 do keyTrend[k].free; end. The compiler accepts the for-loop in the initialization section. The message results from the finalization section. Tom