|
i get a message that the process don't have job to do.
|
|
|
|
|
Doesn't mean anything to me
|
|
|
|
|
Try debugging the service to see what error is occuring. You can do this by adding the line below to your Main method before calling ServiceBase.Run :
System.Diagnostics.Debugger.Launch();
|
|
|
|
|
I can debugging in Visual-Studio?are ou sure?
|
|
|
|
|
noamtzu00 wrote: are ou sure
Well try it and find out.Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
Works for me.
Usually I would attach to the running process, but in this instance you are dealing with the OnStart method so the only way is to make the code launch the debuger.
|
|
|
|
|
Hi All
I have a small doubt regarding a Forms.Timer and WM_TIMER.
If I remember right each System.Windows.Timer.Forms triggers an event ( bounded to the Tick event )
for each WM_TIMER message coming from the message pump of the Form where is included.
Since each of this WM_TIMER messages comes from the main message queue of Window OS,
if I Have 30 forms on my screen, each with its own Forms.Timer object updating
some graphic component of the form (label text, or other ), can I say that
each form will be strictly updated one after one?
I don't know how WM_TIMER is dispatched and processed in each form given that
the queue of the OS is unique and shared by all the forms.
Regards
Manustone
|
|
|
|
|
manustone wrote: can I say that
each form will be strictly updated one after one?
No, you can't predict order of update. I woud recommend a custom event placed on a global, so that all forms inside process coud accsess and one timer. Every form can subscribe to that event, and Timer.Tick event can fire other events in other of subscription.
|
|
|
|
|
Thanks for your response!
|
|
|
|
|
30 forms on your screen? I do hope you have a large monitor.
Each form, being a window has its own message loop. WM_TIMER messages are posted (ie. asynchronous) to the loop and are fired pretty much 'on idle'. Should one of you forms be busy, the timer event won't get through so you really can't guarantee order, or for that matter regular updates.Regards,
Rob Philpott.
|
|
|
|
|
Hi Rob! Thanks for your reply!
So at the end regular updates cannot be guaranteed using WM_TIMER.
What if I use 30 System.Threading.Timers for that purpose?
Do C# create a thread for each System.Threading.Timers or not?
If it does than probably it is better a ThreadPool..
what are your thoughts?
|
|
|
|
|
If all the timers must have the same interval, the best option is to use only one timer for all.
|
|
|
|
|
I have to make a slider control for a website that I am building. However, I cannot use any javascript or ajax. I have searched everywhere and tried a few things, but cannot find any solutions that do not contain scripting. Can anyone point me in a good direction?
Thanks!
|
|
|
|
|
heidi stapel wrote: , but cannot find any solutions that do not contain scripting
What you wan't doesn't exsist. If control is not part of browser, then it can not used without scripting. Maybe you would need to use ActiveX but it requires local computer to have installed it. The best aproach is Ajax and Javascript.
If you still want to use it, Download firefox, modify html parser to accsept new html tag. Make sure it is installed on computer that was accsess your site.
|
|
|
|
|
|
I would re-evaluate the requirements. Not using JavaScript or Ajax makes no sence at all and will be very difficult to implement without and almost certainly not browser independent I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
i have a strange problem. I can update any main thread control from a different thread without any cross thread exceptions. I can change the text of a textbox from the thread and from any button click handler in main thread. What are the possible causes of this kind of behavior? Can it somehow remember that i have used invoke on the controls?
When i do the exact same thing in a new project i get the crossthread exception.
An illustration of what i mean:
private void button1_Click(object sender, EventArgs e)
{
Thread someThread = new Thread(Threadfun);
someThread.Start();
}
private void Threadfun()
{
label1.Text = "hello";
}
tymodified on Thursday, February 25, 2010 10:50 AM
|
|
|
|
|
Are you compiled it under .NET framework? I know that in .NET2.0 was added detection.
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:09am.
|
|
|
|
|
.Net framework 3.5
stancrm, i know that this is the way to go but my problem was that i was able to chagne the parameter without invoking
|
|
|
|
|
The only whay that it doesn't throw you is that you either used try catch to handle error or that control is created on a same thread as thread that is modifying your control. You can check AnyControl.InvokeRequired proprty
|
|
|
|
|
some Control operations are harmless and work across threads without causing an exception; example: reading Label.Text.
As this is undocumented, you should not rely on it.
I collected the most relevant information here[^].
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
There is a setting you could check:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.checkforillegalcrossthreadcalls.aspx
Interesting, according to that page exceptions are only thrown if debugging (which I hadn't realised). Are you debugging?Regards,
Rob Philpott.
|
|
|
|
|
Rob Philpott wrote: exceptions are only thrown if debugging
Didn't know that and so I checked it with a Threading.Timer modifying a Label.Text;
throws an exception inside Visual Studio; however even a debug build will not throw an exception if run outside Visual Studio.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Hi,
Why we do always associate events with delegates? Why a normal function cannot be called when an event fires ? What is the advantage here when delegates are called when an event fires ?
Thanks
|
|
|
|