Click to See Complete Forum and Search --> : Refreshing the GetTCPStatistic method
kirannapit
March 12th, 2004, 06:24 AM
hi,
is there any simple method from which i would refresh the values shown in dialog box get refreshed after some time as the new values get received by GetTcpStatistic method.
Also i dont want user to press refresh button additionally,and also threading will increase my code.
What i tried is put the thing in while loop , but , simeple thing of cheking stop button pressed is not somehow working or may be i am wrong
kiran
Andreas Masur
March 12th, 2004, 06:59 AM
Well...indeed using a thread which receives the updated values and sends the update to the dialog would be the appropriate way to do it...
kirannapit
March 19th, 2004, 04:48 AM
i tried threading, but there is some difficulty(newbie to threads)
i created a simple thread and called using Afx*** method(), it works but the handle to dialog box for refreshing the and showing the results is not working, since i am using static function as thread , i am not able to access the memeber of dialog class where i show my results
some code on this will be greatly helpful
kirannapit
March 22nd, 2004, 04:15 AM
look at the problem
i have a dialogbox where i display my static text,by calling a thread function Threadproc. This Threadproc fucntion is global and implemented in the dialog class's cpp file. i am getting the values in this Threadproc function,but Threadproc is global function , hence i cannot get the handle to dialog's static box's memeber's where i need to display the values.so how do i get the handle in Threadproc fucntion to update dialog boxes's values.
i tried with folliwn code but it fails and gives assertion
Cmydialog *pdlg;
pdlg = (Cmydialog *)lpthreadparameter ;// this is parameter of thread fucntion
hence i tried to write showreult function in Cmydialog class, but how do i call this fucntion in Threadproc fucntion.
it is ****ing my mind.
codeguru.com
Copyright 2007 Jupitermedia Corporation All Rights Reserved.