Refresh on OnTimer() event

Hi everyone,

I have developed a network monitoring application. One of 
its function is to display appropriate 

images in the display for each node; depending on whether 
the node is ON or OFF.

For this, I have created an array of CStatic objects.I 
have assigned images to these objects upon 

initialization:

CStatic win_bitmap[255];
win_bitmap[i].SetBitmap(...............);

Now I want the display to be refreshed after an interval 
to display the current status of machines.
I have used the 'SetBitmap' function of CStatic for this 
purpose.

But the bitmaps disappear as the timer event occurs.

Please suggest a solution...........


Nitin.

0
anonymous (74717)
12/9/2003 11:25:50 AM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
752 Views

Similar Articles

[PageSpeed] 32

Nitin wrote:
> Hi everyone,
> 
> I have developed a network monitoring application. One of 
> its function is to display appropriate 
> 
> images in the display for each node; depending on whether 
> the node is ON or OFF.
> 
> For this, I have created an array of CStatic objects.I 
> have assigned images to these objects upon 
> 
> initialization:
> 
> CStatic win_bitmap[255];
> win_bitmap[i].SetBitmap(...............);
> 
> Now I want the display to be refreshed after an interval 
> to display the current status of machines.
> I have used the 'SetBitmap' function of CStatic for this 
> purpose.
> 
> But the bitmaps disappear as the timer event occurs.
> 
> Please suggest a solution...........
> 
> 
> Nitin.
> 

If the code is like you show then the CStatic objects are allocated on 
the stack.  Stack allocations are destroyed when the function returns. 
You also don't mention subclassing: It must be used to 'connect' each 
CStatic object with its static control.

Make the array a member variable so it will remain allocated for the 
life of the parent.  In DoDataExchange add a loop to call DDX_Control 
for each object to connect it to the control.  You will also have to 
make the control ID's in resource.h sequential so you can compute the 
next control ID in your loop.

-- 
Scott McPhillips [VC++ MVP]

0
scottmcp1 (239)
12/9/2003 12:58:20 PM
Reply:

Similar Artilces:

calculated control event order
I have a continuous subform with a calculated control in the footer to total a field on the subform. I'm trying to use events/code to "copy" that total to a bound control in the main form. Can't just use a calculated control on the main form (=subform!total) because the "total" on the main form may be over-ridden by a value at users discretion. I've tried using the AfterUpdate event (as well as others) of the subform control that can change (and therefore change the value of the total), but it appears that the calculated controls are not being...

how do i refresh or sync all?
I am trying to force my mail to refresh, or to look for new mail much like Outlook Express does when you click on "Sync All". Maybe I shouldn't be concerned with this. Does Outlook deliver mail as soon as it is processed by the server or is it sent at preset intervals set by the administrator? Les perhaps you mean Send/Receive ? Still learning wrote: > I am trying to force my mail to refresh, or to look for new mail much like > Outlook Express does when you click on "Sync All". Maybe I shouldn't be > concerned with this. Does Outlook de...

Refresh some not Refresh All
Hello. I have a workbook with 10 sheets all of which have external data that needs to be refreshed periodically. Most of the time I only need to refresh 8 of the sheets. Is there a way to refresh just those 8 without having to refresh each one separately? Thanks in advance. You can use a macro to do it. It would go something like this... Sub RefreshSome() Dim wks As Worksheet Dim qt As QueryTable For Each wks In Worksheets Select Case wks.Name Case "Sheet1", "sheet2" Case Else For Each qt In wks.Que...

add .NET unregister event capability from VS Tools
Because of the architecture of the .NET wrapper classes for GP resources it's critical to be able to unregister events. Othewise some nasty workarounds have to be enginneered to go around this limitation. Case in point: When using FormFactory to launch wrapper forms or own forms one will potentially register to a state field on the dex window exposed via the dex form. Each time the wrapper form is launched it registers a new event handler to the same event. When the form wrapper object gets disposed the memory will never be reclaimed by the gc because of the stray delegate to the e...

Event ID 9348 and Error 8004010F
We recently migrated from one Exchange Server 2003 SP2 server to another and both systems are running on 2003 Server SP1. Since replicating and rehoming the folders and services and transferring the mailboxes, per MS article ID 822931, we have been receiving the following error messages daily or when we rebuild the default global address list. OALGen encountered error 8004010f while loading the template /O=MUSCATINE COUNTY/cn=Configuration/cn=Addressing/cn=Address-Templates/cn=403. This address or display template will not be available for client download. - Offline For more inform...

Using moExcelApp_WorkbookBeforeClose() event
When using: moExcelApp_WorkbookBeforeClose(ByVal Wb As Excel.Workbook, Cancel As Boolean) and there are many opened sheets, how to check that one particular sheet is beeing closed? Jack It gets the wb passed as one of the parms. You can use wb.name or wb.fullname and check that. Jack wrote: > > When using: > > moExcelApp_WorkbookBeforeClose(ByVal Wb As Excel.Workbook, Cancel As > Boolean) > > and there are many opened sheets, > > how to check that one particular sheet is beeing closed? > > Jack -- Dave Peterson That's what I have probl...

Refresh 1 subform from another
I am trying to refresh a subform from another subform and I cannot seem to make it work. I have a button on subform 2 that needs to have subform1 refresh. I used Me.subform1.mainform.form.refresh and I get an error that says Method or Data Member not found. Anyone know what I did wrong? I am thinking I should use ! instead of . but I don't know what the difference is between them. Any help? -- Thanks As Always Rip Ripper wrote: >I am trying to refresh a subform from another subform and I cannot seem to >make it work. I have a button on subform 2 that needs to have su...

Users have no master SID errors in event logs (event id 9548)
There are loads of these errors on our Exchange 2003 server in the events: Disabled user /o=CompanyNameLtd/ou=London/cn=Recipients/cn=Bristol/cn=Harry does not have a master account SID. Please use Active Directory MMC to set an active account as this user's master account. are these accounts that had mailboxes and have been disabled? does this apply? http://support.microsoft.com/default.aspx?scid=kb;en-us;555410 "SW" <SW@discussions.microsoft.com> wrote in message news:2CA9AB75-AF36-45EA-9DB7-818D1FA32562@microsoft.com... > There are loads of these errors on our...

How to change the unchangeable 18 hour event reminder?
I've seen it posted quite a few places that it can't be done but that's history. New things are always happening. So... How can I change the default "18 hours" reminder when I create an all day event? More importantly... how can I change it on all of the installations in my network. It has become a minor frustration when the CEO sends out an all day meeting request (event) with a 2 day reminder and very recipient sees the 18 hour default. Yes, I know there are bigger problems out there... world hunger and flipping plug receptacles so the "face" is right-sid...

event id 3015 and 3018
Hello Group, the queue messages awating delivery lookup is very large and on the application log appears many times this events 3015 and 3018. thank Im ...

Cells WON'T stop refreshing automatically
I have a workbook with many worksheets and links that I need to publish externally with links locked so that users won't get the "The workbook you opened contains automatic links..." message. I have gone into <Tools> <Options> <Calculation>, unchecked the <Update Remote References> checkbox, and saved the workbook; however, each time I reopen the saved workbook, the <Update Remote References> checkbox has been rechecked by some mischevious gremlin, and I invariably get the "The workbook you opened contains automatic links..." mess...

VWD2008 will not refresh HTML file
I am trying to use the showmodaldialog function to display help files for my website. But when I make modifications to the HTML file, a previous version of that file is displayed from within the VWD environment, even if I just want to debug that file. I have restarted VWD, but the old version is still displayed. When I double-click that same file outside the VWD environment, the modified version is displayed, so I know the changes are being saved. I have searched the entire hard drive and there is no other file with the same name. ...

Refreshing
Hi !! I ve done a OCX to view certain type of images. The OCX has a dialog in it with buttons. This OCX has been loaded into a html page. When multiple OCX are being placed in the html page I find the images that are displayed flickers. I use invalidate to refresh but refreshing is very fast. What should I do now to make smooth refreshing. Thanx Sudharsan Double buffer the image. Create a memory bitmap, copy to it, the BitBlt to your OCX's HDC. This may increase CPU usage a little. "Sudharsan" <Sudharsan@discussions.microsoft.com> wrote in message news:A72BC9BB-...

How can I copy Double-Click event behavior to multiple shapes in Visio
Hi, How can I copy the double-click event behavior to many shapes in my Visio drawing? I'd rather not have to visit the ShapeSheet for each shape and paste the formula into the EventDblClick field, since I have a lot of shapes to do this to. Is there a way to do that? Thanks, Joe Either write some VBA code to set the Dbl-Click property or try Visio's ShapeStudio that comes with the SDK kit. John... Visio MVP Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm Need VBA examples? http://www.mvps.org/visio/VBA.htm Common Visio Questions http://www.mvps.org/visio/com...

Event reminders
Hi All I have Outlook 2002 and have a bit of a problem. You know when you set a reminder for an appointment or something similar, then your reminder pops up and tells you "it's time mate" Now, this will happen as long as the outlook is open, but it won't if outlook is closed. Is there any way I can enable the reminder to sit in the sys tray and pop up when scheduled even if the outlook is closed ? I used to have Works Suite 99 before and the calendar had the reminder doing exactly that. Any help will be appreciated. Outlook needs to be open for any part of it to work...

"The connection was dropped due to an SMTP protocol event sink." #2
Hi. I have Exchange 2003 with Windows 2003. The Exchange Server is also a domain controller. For the last month any mail we send to a particular domain (and only to that) is being delayed and gets stucked in the queues. When iam using an external account outside of my organisation everything goes well and the recipients for this particular domain can get the mails which i send them. My DNS is working well. To be more specific when i go to queues on my Exchange System Manager and find this particular domain, on additional queue information i get the following message. "The connectio...

Exchange 2003 server 9317 Event messages
I rebooted our 2003 server domain controller and our 2003 member server which has exchange 2003 sp1 installed this morning. There are two events with an ID of 9317... relating to the exchangeSA. "Failed to register Service Principal Name for exchangeMDB; error code was c007200e" the 2nd one is for exchangeRFR. The SA has started ok and all appears to be working ok. Theres not much informatiion on this error anyone any idea of a fix ? or cause ? the exchange server is a member of the Exchange Domain Servers group. http://eventid.net/display.asp?eventid=9317&eventno=3204&...

AJAX UpdatePanel does not refresh after calling Update()-Method
Hi, I'm new to AJAX and has a little Problem to get an UpdatePanel inside an CustomServerControl to work. My goal is to create an CustomServerControl with an (at designtime) unknown number of UpdatePanels, that can be updated seperatly. Since I'm stuck I create a litte more static testproject to analyse the problem but I ran out of ideas what I could been missing. I would be realy glad if someone can show me hwo to get the UpdatePanels working. I created an ServerControl-Project called ServerControlTest and an ASP WebApplication called AXAJTest The Default.asxp look...

Clipart Woe -- how to refresh location
How can I refresh the path to the clipart gallery for the clipart files? I have moved the clipart from a network location to the local harddrive and rebuild the artgal50.mmc file, but the gallery still looks to the network location?? Help is greatly appreciated, because searching the MS resources is drivining me nuts Nigel Nigel, they are coming to take you away, take you away. If you hear a knock on the front door, do not open it as it may be the fine gentlemen with a while jacket with straps on. Nigel, you are driving us nuts not telling us what version of Windows and Publisher you...

Web Query Refresh problem
Hi I've set up a workbook that contains about 75 sheets. Each sheet contains a web query. I then have a summary sheet which summarises the actual part of information that I want from each web page. Everything works fine, most of the time. I've set up a little button to 'refresh all data'. However, sometimes the refresh doesnt seem to work on some of the sheets. It actually pulls data from a website which I've set up on a different sheet. If, however, you go to that individual sheet, and manually refresh that sheet, it pulls through the correct data from the web. Som...

Event 1003 Error code 1000000a blue screen/system fail errors!
Hi I keep getting errors such as this below- Event Type: Error Event Source: System Error Event Category: (102) Event ID: 1003 Date: 24/05/2010 Time: 23:46:49 User: N/A Computer: CHRISS_ROOM Description: Error code 1000000a, parameter1 00000010, parameter2 00000002, parameter3 00000001, parameter4 804dab1b. For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. Data: 0000: 53 79 73 74 65 6d 20 45 System E 0008: 72 72 6f 72 20 20 45 72 rror Er 0010: 72 6f 72 20 63 6f 64 65 ror code 0018: 20 31 30 30 30 30 30 30 1000000 ...

Chart source data invalidated when workbook refreshed
Hi all, We have a workbook with vba code which fetches data from the backend and displays it. Now i have a chart defined for some data in this workbook and then i refresh this workbook. The problem is the chart source data is invalidated for the new workbook data. Any solution for this ? Any help is highly appreciated :-) Louis - How does the macro refresh the data? Could you make use of a dynamic chart instead, for example, one that charts the last N points in the table? Here's some Dynamic Charting examples and links: http://www.geocities.com/jonpeltier/Excel/Charts/Dynamics...

Exchange Event Service Problem
We are trying to implement a third party application that utilizes Exchange server and Outlook calendars. The Application developer states that the Exchange Event Service needs to be running for their application to work. We have Exchange 2003 SR1 running on Windows Server 2003. When I start the Exchange event service it immediately starts records an error and then stops. Both start and stop are recorded in the application event log as successful the error between the two is this: ============================ Event Type: Error Event Source: MSExchangeES Event Category: General Event ID...

CWebBrowser2 and Refresh
Hi All, I am using CWebBrowser2 control to get values from a website then plot them on a chart. When I use Navigate2(..) I can handle the OnDocumentCompleteExplorer(..) message to parse the html file and update my chart. However, I don't always get an updated page, can someone give me an example of how to use Refresh2(..) to make sure I always get a non-cached page? Also, is there a message sent when Refresh() or Refresh2() has finished? Or maybe there's another way I can achieve what I want? Cheers, Rob ...

Events of databound checkbox
Hi, i have created a form with a checkbox that is checked if the current record is found in another table. This works perfectly with a selection query. Now I want to append the record to the second table if the user checks the checkbox and delete it if he unchecks it. However the onClick event doesn't seem to get fired, does it? How can I do that? Thanks in advance Use the After Update event -- Dave Hargis, Microsoft Access MVP "julius.fuchs@yahoo.de" wrote: > Hi, > > i have created a form with a checkbox that is checked if the current > record is found in ano...