You can go to the WM_PAINT (OnPaint()) of the dialog and add the following code CRect rect; CBrush brush(RGB(100, 0, 0)); dc.GetWindow()->GetWindowRect(&rect); ScreenToClient(&rect); dc.FillRect(&rect, &brush); dc is CPaint dc(this); Harsha ---------------------------------- http://www.ece.arizona.edu/~hpg ----------------------------------
Harsha Gopal
Posts
-
Background color of Dialog -
Resource Access in Multiple Timers in Single threadI am sorry that I misunderstood the question... Anyway, I think critical sections can be used within the same thread. Although developed for multithreading, I suppose that critical sections do not understand which thread they should give access; they just know which resource to lock. Harsha ---------------------------------- http://www.ece.arizona.edu/~hpg ----------------------------------
-
Resource Access in Multiple Timers in Single threadRaja, Why dont you consider using the Critical Section to avoid simultaneous access to the same resource... So, when the timers get called simultaneously, only one timer accesses the resource and the other waits till the critical section is released. If the application spans processes, you should be considering Mutex... Hope it helps you... Harsha ---------------------------------- http://www.ece.arizona.edu/~hpg ----------------------------------
-
new & delete questionThe way have allocated memory to the pointers, I suppose that one delete statement should be sufficient. Reg. your second question, may be you can consider using const Object obj; obj=&m_myClassObj->myReadFunction(); Harsha ---------------------------------- http://www.ece.arizona.edu/~hpg ----------------------------------
-
How to count ...That should be simple if you use "System.Environment.TickCount" which return time in milliseconds since your system was powered on. Harsha ---------------------------------- http://www.ece.arizona.edu/~hpg ----------------------------------
-
What's that? I can't add more variables in a class - then the whole program doesn't work!Hi, I had some problem like this when I used new operator to create an object of a class (a class containing objects of other classes). So, I could get around it by using malloc.... Although, it may sound unprofessional, you may want to give it a try.... Also, if your recently added variable is a static instance of another class which needs dynamic memory allocation, it would be wiser to use a pointer instance of the new class... Pl. share if it solves the problem. Harsha ---------------------------------- http://www.ece.arizona.edu/~hpg ----------------------------------
-
Couple of questions concerning bitsThe compiler assumes it as a 16-bit number. So, 0x1F = 0000000000011111 0x1F << 6 = 0000011111000000 = 0x7C0. So, for 8 - bit operation may be u can write as unsigned long a = 0x1F; a=LOBYTE(a<<6); It gives the desired result....You can fit it into your program... Harsha ---------------------------------- http://www.ece.arizona.edu/~hpg ----------------------------------
-
Prevent ALT F4Intercept the WM_CLOSE message and return false. If you are using MFC, goto classwizard and add WM_CLOSE message handler to that particular window and remove the CDialog::OnClose() statement. Harsha ---------------------------------- http://www.ece.arizona.edu/~hpg ----------------------------------
-
Where's the rollover articleYou can create a ImageButton. Then, you can add attributes like ImageButton1.Attributes.Add("onMouseOver", "this.src='go.gif'"); ImageButton1.Attributes.Add("onMouseOut", "this.src='submit.gif'"); This will create an image rollever effect. I can say that this is a server-side control having a rollover effect established in the client-side. I think I answered your question..... Harsha. Harsha ---------------------------------- http://www.ece.arizona.edu/~hpg pg_harshavardhan@hotmail.com ----------------------------------