|
hi again,
Dave Kreskowiak wrote:
is to destroy the Timer, using Dispose, and recreate it with the new interval.
i done this, just it didnt work
i disposed the thread and make a new instance with intial state aborted and stopped just it didnt stop until it finished.
Thanks in Advance
Mahmoud Manasrah
|
|
|
|
|
Whoops! Might have helped if a read the entire question again. I've never tried it before, but you might want to try setting the AutoResetEvent you used to create the Timer.
Dim autoEvent As New AutoResetEvent(False)
Dim timerDelegate As TimerCallback = AddressOf ...
Dim delayTime As New TimeSpan(0, 0, 1)
Dim intervalTime As New TimeSpan(0, 0, 0, 0, 250)
Dim stateTimer As Timer = New Timer( timerDelegate, autoEvent, delayTime, intervalTime)
.
.
.
autoEvent.Set()
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
r u sure that this is the solution!
well the problem is not in running the timer, or in calling it back...
The problem is when i stop the timer..it dont stop until it ends the current process it is doing..
like if it was sending emails for 25 persons, and i click stop, it dont stop until it send to the 25 person...just it dont callback the timer...
i want to stop the thread which the timer is executing immediatly , and not wait until its done...
Thanks in Advance
Mahmoud Manasrah
|
|
|
|
|
Like I said, I've never done it before. So how can I be sure that it's going to work?
You never said anything about stopping the callback method that the Timer is executing...
You'll have to rewrite your code so that this callback method checks for a flag every once in a while to tell it to stop. This has nothing to do with the Timer functionality at all!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
You've asked the most generic question we've seen in a long time. What kind of control? Web Forms based or Windows Forms? What do you want this control to do?
If all you want is a tutorial on creating controls, the forums is not the place to look. There are entire books and websites dedicated to the subject. Try searching, Yahoo or Google, for "tutorial windows forms control", if that's what your looking for.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello all,
I need the control for .net arabic DateTimePicker Control(Ocx or Dll ,dll is prefered) which is display the hijri calender.If anybody have send to my mail(rugfy@yahoo.com)
otherwise suggest me the website
Thanks..........
Ishak
|
|
|
|
|
if u explorer this site and web u will find few article on creating ur own date/time control so why don't u try to make one urself and then ask the problem about ur codes
Computer... Programming... What That
|
|
|
|
|
I need it very urgent
Ishak
|
|
|
|
|
how can I get serial processor number in VB6??
|
|
|
|
|
Most systems have it turned off by default, and not all systems support a CPUID. Don't try and use it for licensing.
But, if you must, you can get the ProcessorID using WMI and the Win32_Processor class.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi, I wrote a windows service that starts fine when it is started manually, but when rebooting it times out(SCM 30 sec time-out). I've written some log code(to a textfile) in the Onstart() method to determine what section of this method is taking up too much time. Once again everything works fine when the service is started manually and it takes about 5 secs to start, with all the log information visible in the file. But when rebooting, it times out, before it even makes the very first entry into the logfile, which is the first thing it's suppose to do in the OnStart() method.
Can this be because the windows filesystem is not up and running yet on a reboot? Or possibly something else that my service is dependant on that didn't start yet?
Any ideas for possible("neat" or not so neat) solutions are welcome.
Thanks a lot.
Fanie
|
|
|
|
|
is there any log files generated with scheduled task? and how can i access it remotely with vb.net? thanks
|
|
|
|
|
The log is kept in a simple text file at C:\WINDOWS\SchedLgU.Txt
You can get to it via normal file methods using a UNC path: \\machinename\C$\WINDOWS\SchedLgU.Txt
That is, of course, if the target machine is in the same domain as your machine. Authentication to the target machine may become an issue if your not running in a domain environment.
You'll have to come up with your own code to parse up the log file into a suitable data structure.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks.. what if the scheduled task didn't run at all? would it still be on the log file?
|
|
|
|
|
Read through the log file to understand it. The log will show that the job was launched, any error that were encountered launching the job, and the jobs return code, if any. If no attempt was ever made to launch the job, then it won't show in the log.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks.. yeah.. i've scanned throught the log and i traced a task that supposed to be run at a given time but it didn't show on the log.. so how can i monitor it? i mean how can i know that the task didn't attempted to start or run at all?
|
|
|
|
|
That should be obvious! If you're monitor already knows the Task Name and it doesn't show up in the log, well, what do you think didn't happen?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How to show 2 lines seperated by Enter character, just like this:
Hello line 1
Hello line 2
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
The hack - VB.CrLf ( or something like that )
The programmers way - Environment.NewLine
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
It's easy.. make use of the VBCRLF - this means new line and return e.g.
dim tmpStr as string
tmpstr = "Hallo Line 1" & VBCRLF
tmpstr &= "Hallo Line 2"
msgbox tmpstr
this will show it as follow
Hallo Line 1
Hallo Line 2
Hope you understand -
|
|
|
|
|
I'm using a comercial XYgraph control and I'd like to overwrite the OnPaint event in order to add one vertical line inside it. The problem is that this control does not fire the OnPaint event. I dont know why because of this event is in the list of available events (in VB IDE)
Could anyone help me with that?. Is there another manner to do it without use Onpaint event ?.
Thank you.
german
|
|
|
|
|
If this control does not have an onpaint event, then it cannot be drawing a graph. The OnPaint is fired by the framework though, it's caused by windows being invalidated.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thanks Christian,
But, the control has an Paint event, but when I put some code there nothing happends.
Private sub XYGraph1_Paint(ByVal Sender as Object, ByVal e as System.Windows.Forms.PaintEventArgs)
Msgbox "Never passed here"
End Sub
german
|
|
|
|
|
You have the source code for this control, and it does not have it's own paint method ? It must have a paint handler, even if it's in a control class.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|