|
Thanks for your reply Navaneeth
Yes, the OnStart calls a function..here's the sample code..
public void Start()
{
int intervalEnqueue;
try
{
intervalEnqueue = 600;
timer1 = new Timer(new TimerCallback(LLPlusProcess), null, intervalEnqueue, intervalEnqueue);
}
.....and here are some content of the function.....
public void LLPlusProcess(object state)
GetSMSResult getIncomingSMSResult = new GetSMSResult();
getIncomingSMSResult = null;
service = new Service();
service.Credentials = System.Net.CredentialCache.DefaultCredentials;
// get Incoming SMS with Waiting status
getIncomingSMSResult = service.GetSMS(System.Configuration.ConfigurationManager.AppSettings["clientAppKey"], System.Configuration.ConfigurationManager.AppSettings["enqueueStatus"], "Waiting", Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["enqueueRecord"])); <---- calls a web service function here
string getIncomingSMSResultResponse = getIncomingSMSResult.ResponseMessage;
System.Diagnostics.Debug.Write(getIncomingSMSResultResponse + "\r\n");
GetSMSResultMessage[] getIncomingSMSResultMessage = null;
getIncomingSMSResultMessage = getIncomingSMSResult.Message;
....etc...
If getIncomingSMSResultMessage is NULL then it will go here..else it will save the data in the database..
catch (Exception ex)
{
System.Diagnostics.Debug.Write("ENQUEUE [EX] : " + ex.ToString());
}
System.Threading.Thread.Sleep(100);
enqued = false;
}
else
{
System.Diagnostics.Debug.Write("\r\n ---- ENQUEUE PROCESS ON GOING ----\r\n ");
}
It will loop for how many times (as per my log files) but still it will end to error i mentioned..
But if i double click the exe file from debug folder..it run successfully..is it normal for a web service exe to be manually run? Some says it shouldnt be running that way..because exe file will look for the services for it to run...
Please help..Regards!
|
|
|
|
|
obrix_activex wrote: is it normal for a web service exe to be manually run?
Not usually, but you can write one that does.
What type of Timer are you using? I use a System.Timers.Timer for my Services.
|
|
|
|
|
H! PIEBALDconsult!
The program uses System.Threading...You may refer to my previous messages regarding my problem..
I'm confused to where is really the problem occurs..is it in the code or the way i built the service installer?
Thanks!
Regards
|
|
|
|
|
Hi Obrix!
m also facing the same short of problem to windows service
did u got solution??
please share
|
|
|
|
|
I debugged the program and the entire 'timer1_tick' event is SKIPPED. Here's the link to download the program. If anyone can fix my program, upload the edited program on sendspace and provide the link.
http://www.sendspace.com/file/j0tkw3[^]
I am pretty sure the mistake is in the timer1_click event or in the property of the timer1.
Also on a side note, I am new to the code project and I want to know if uploading a project file here is possible. If so, please tell me how.
|
|
|
|
|
No, you can't upload a project, and we probably won't download it. How about you give us the code that creates the timer ? You're saying you set a breakpoint in the timer and it never fires ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Open Form1 in the editor. Select the timer1 component - it's in the gray area below the form. Right-click on it and select "Properties". There's a list of properties on the right. Above that list is a small icon with an icon that resembles lightning. Click on it, and you'll get a list of events. Click on the Tick event and set it to timer1_Tick . That should hook up the handler.
Alternatively, you could do this from code. Double-click on your form in the editor to create an OnLoad event, and add this code;
private void Form1_Load(object sender, EventArgs e)
{
timer1.Tick += this.timer1_Tick;
} Welcome to CodeProject
I are nuts today
|
|
|
|
|
Wow - you can set timers in the designer ? I've never tried that ( nor am I likely to, but.... )
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
yes, a lot of non-GUI stuff can be designed: timers, BackgroundWorkers, SerialPorts, ...
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Thanks, I didnt put it in the form_load event, instead put it in the start event and now my program works. LOL I can't believe I didn't realize that my tick event was never executed. THANK YOU VERY MUCH!
Edit:
I had to add a timer1.Tick -= this.timer1_Tick; on pause & restart though and I had to disable pressing restart on pause. Oh well, at least the program works. Thx
modified on Monday, June 22, 2009 2:09 AM
|
|
|
|
|
Hi,
do you have a timer1.Start(); statement somewhere, and are you sure it gets executed?
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
I'm sure that there have been a thousand questions on this topic, but here goes...
I have an application that uses the System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces() to retreive each friendly interface name on a machine with multiple adapters. Later, depending on other choices, the application needs to start UDP multicasting. For this I need to be able to find the IP address of the interface chosen. As I said, all I have is the friendly adpter name. How can retreive the IP address(es) of the NIC starting only the adapter name?
Raven
|
|
|
|
|
Hi to all.
Some of programs create thumbnail for its files
like Corel, Adobe reader, AutoCad, and some of weak pictures(like files that have error on download ) that have thumbnail
I want to catch file's windows thumbnail
please help me
|
|
|
|
|
there's a thumbs.db file in the folder, they are in there. Assuming you mean the thumbnail you see in Windows Explorer.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Are they if you set Windows to not cache it? Also there aren't going to be these files created on read-only media, so I guess there muse be some API for that...
Jan
|
|
|
|
|
Do you know how can I get the corresponding project of a custom component at design time?
For example: a custom list box resides in a form which belongs to a project. I need to access that project, from inside of the listbox, at design time.
Thank you.
Bogdan.
|
|
|
|
|
What do you mean, 'access the project' ? The csproj file is not there, nor can you change it's settings in the compiled dll. If you want the name of the project, if it happens to be the name of the main namespace, as is the default, you can get the name via reflection, but, given that it never changes, I assume this is not what you mean ( plus, I can't think of any reason to want to do this )
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hi,
I'm currently working on a project were I want to be able to extract information from the currently displayed page in a browser control, and also be able to change whats displayed on the page, or add information by my self.
Is there anyone that can point me in the right direction were to start if I want to be able to manipulate the content on the page?
I know HTML and some DOM, now it's just how i can access the code behind to collect data and to change it on the page.
Thanks in advanced.
modified on Tuesday, June 23, 2009 9:42 AM
|
|
|
|
|
Okay, I think that I understand the issues affecting C# equality testing (including numerical precision, type conversions, boxing etc) - e.g. http://blogs.msdn.com/jmstall/archive/2005/03/09/390135.aspx[^] - but I don't understand the statement in MSDN (http://msdn.microsoft.com/en-gb/library/bsc2ak47.aspx[^]):
x.Equals(x) returns true, except in cases that involve floating-point types. See IEC 60559:1989, Binary Floating-point Arithmetic for Microprocessor Systems.
Can anyone please explain? How can this sometimes evaluate to false?
(I couldn't find anything interesting re: IEC 60559:1989 - still Googling though.)
P.S.
double d = Double.NaN;
d.Equals(d);
"...there's what people want to hear, there's what people want to believe, there's everything else, THEN there's the truth!" - New York D.A., The International
|
|
|
|
|
Hi,
the MSDN documentation on Object.Equals says:
This method can be overridden by a derived class.... The following statements must be true for all implementations of the Equals method...
x.Equals(x) returns true, except in cases that involve floating-point types. See IEC 60559:1989, Binary Floating-point Arithmetic for Microprocessor Systems.
so all it says is xfloat.Equals(xfloat) is ALLOWED to return false; it just leaves the Equals() result for floats undefined.
The IEC standard isn't available for free, so I can't check this, however I assume they call the result of x==x undefined, hence hardware that implements IEC 60559:1989, and software running on such hardware, would find it difficult to enforce x.Equals(x) returns true.
The fundamental reason is it does not make sense at all to test two floats for equality; by their very nature, float values are either close to each other (difference less than epsilon), or they are not. Zero does not exist in nature.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Luc Pattyn wrote: Zero does not exist in nature.
Shhhhhhhhhhhhhh, please don't tell it to Zero. It assumes its existance having the same dignity of 1, 2, pi and so on.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hmmmm, pie
I are troll
|
|
|
|
|
I think that the standard states that NaN may be treated as not being equal to NaN - which seems fair as operations resulting in NaN are NOT returning an an actual numerical value. .NET does however treat them as equal when using Equals() but not when using ==.
I can't see how x.Equals(x) can evaluate to false for real numbers (whatever the implementation) when the 2 operands are references to the same object.
Do you think that MSDN is really just saying not to rely on it - even when referencing the same object? (If so it would be useful if they stated thay some other comparison should be used with reference to Epsilon.)
"...there's what people want to hear, there's what people want to believe, there's everything else, THEN there's the truth!" - New York D.A., The International
|
|
|
|
|
As I said, MSDN requires an inherited Equals to return true for x.Equals(x) unless x is of type float/double, in which case there is no such requirement at all.
Your point on one NaN not being equal to another NaN is absolutely valid; anyway, x.Equals(y) is not supposed to first check if x and y refer to the same object. So if they both refer to the same float variable and that happens to be NaN, then is really should return wouldn't be wrong to return false!
AFAIK the same argument applies to plus and minus infinity, one infinity does not equal another.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
modified on Sunday, June 21, 2009 2:14 PM
|
|
|
|
|
Hey everyone,
Any idea why one of my fields in a crystal report totally disappear from the report during runtime?? Everything related to that field, the header lable, the data field, and even the summary field!! All the other fields are just fine and were created just like this one by dragging them from the database field tree.
Many thanks!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|