|
I don't want to be the one to aske the obvious question - but I'm going to.
Why are you not using the Windows Task Scheduler?
|
|
|
|
|
I am using windows task scheduler. However it will not run the program properly becasue it does not seem to maintain focus on the proper window. From reading so posts online if doesn't seem the the sendkeys function works when you pc is "locked." I understand that but not sure how to covert the sendkeys function to something that will worked even if the PC is locked.
|
|
|
|
|
Okay - The next question: Why does an application that is lauched from the task scheduler have a user interface? If you have a user interface for configuration then set up a command line argument that the Task Sdheduler uses to suppress the user interface.
|
|
|
|
|
Ditto. Start the app without an interface using the command line args to drive the operations you need to perform.
my.Application.CommandLineArgs
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
What the program does is launch an application, then logs-in and runs 4 reports. The problem I have is that I used the sendkeys to log in and run the reports, but from my understand this function does work if I am not logged into the PC (a focus issue). So I am trying to see how to convert sendkeys to something that will work even if I am not logged in.
|
|
|
|
|
farmer wrote: What the program does is launch an application, then logs-in and runs 4 reports. The problem I have is that I used the sendkeys to log in and run the reports, but from my understand this function does work if I am not logged into the PC (a focus issue). So I am trying to see how to convert sendkeys to something that will work even if I am not logged in.
Then start your app like such through task scheduler: "c:\program files\AutoApp.exe" -admin -r1 -r2 -r3 -r4
Inside the app during the constructor or form load, you need to check to see if there are command line args. If there are, you need to loop collection of startup arguments and process the input as required. If -Admin is present, log in as your account. Run each report as specified (like -r1, -r2, etc).
Once your batch processing is completed, kill the app and the form is never displayed. SendKeys is not necessary nor should it be used for this type of functionality.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
as others have said, using command line arguments would be much easier. make the user name and passwords part of the command line argument and then there is no need for a user interface.
|
|
|
|
|
farmer wrote: from my understand this function does work if I am not logged into the PC (a focus issue).
No, it's not a focus issue. The issue is that you are trying to use the user interface to interact with another application, but there is no user interface at all. You can't set focus to a window when there are no windows.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi all,
I have one textbox,called Name which is validated for not blank.
Error msg: txtbox not blank.
if click the submit button,the validation applies and eerrror msg. displays --txtbox not blank.
and the cursor is out from the textbox.
my problem is ,after i got the error msg. the cursor will be placed in the textbox name.
i am using
txtname.Focus() but still it is not working.
If txtname.Text.Trim.Equals("") Then
lblError.Text = "Please enter Name."
lblError.Visible = True
txtname.Focus()
Exit Sub
End If
Thanks in advacce
mahaboobs
|
|
|
|
|
You've already done it correctly if this was a Windows Forms app. I take it, from your "JavaScript" post, that this is a Web Forms (ASP.NET) app?? You may want to ask this question in the ASP.NET Forum.
|
|
|
|
|
Hi,
I am writing a code for a calculator.
My problem is:
when I calculate with
Windows Calculator
I get:
Math.Sqrt(69) = 8,3066238629180748525842627449075
8,3066238629180748525842627449075² = 69
when I do the same in my code in
vb.net 2005 (Variables are Decimal)
I get:
Math.Sqrt(69) = 8,30662386291807
8,30662386291807² = 68,9999999999999
Is there any chance to get the same as in win.cal
Thanks
housekeeper
|
|
|
|
|
U can use a object to store a content otherwise copy the ans to string variable then paste into textbox. Maybe it will work.... Try it if it work reply me.
Thanx's
Rao.
|
|
|
|
|
Square roots are just the estimated values and not the exact one. In case you need more accurate results, I guess you will need to write your own logic.
As far as square root of 69 is concerned, double just works fine for me.
|
|
|
|
|
It's because of the way that floating point numbers are stored and handled in binary.
Just like in decimal, there are some numbers that can't be written down exactly - For example one third is 0.33333 (with repeated 3's forever). So you have this problem:
(1/3) * 3 = 1
but
0.33333 * 3 = 0.99999
To be able to write one third correctly as a decimal number you would need to write infinite 3's after the decimal point. Numbers like this are described as being 'unrepresentable'. It gets worse in binary. In binary many more numbers are unrepresentable. In binary 0.1 is unrepresentable!.
So that value stored in a floating point variable may not be exactly the required value. The decimal type in C# is meant to help with problems like this, but it's not perfect because ultimately some numbers are unrepresentable in decimal too.
You should do some reading about the problems and solutions for floating point number calculations.
There are a few articles on CP that might get you started:
http://www.codeproject.com/KB/dotnet/ExtremeFloatingPoint1.aspx[^]
http://www.codeproject.com/KB/recipes/float_point.aspx[^]
And wikipedia has some information on float point accuracy:
http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems[^]
Windows calc might just be getting it right by chance because it is storing more decimal places. Or it might just be rounding the answer up to make it look correct. Or it might be using more complex number storage/handling to arrive at a more accurate answer.
Writing a truly accurate calculation system is not an easy task. If you really want to be 100% accurate you need to do a lot of study, or consider looking at buying proper numerical analysis software[^]. You might find some of them are open source, which could help give you some tips if you really want to write your own.
Simon
|
|
|
|
|
Hai all,
can anyone send me the javascript for :
textbox allow only numbers with hyphen
Thanks in advance.
|
|
|
|
|
|
And this has what to do with VB.NET??
|
|
|
|
|
Dave Kreskowiak wrote: And this has what to do with VB.NET??
Its alright, he already posted it in the asp.net forum as well
(and his other question )
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Dear Everyone
I am building a VB.Net application with SQL Express following n-tier approach. I have completed the BLL and DAL with VB.Net front-end. I have created all the required SQL SP's for CRUD. Since, I am new to VS.Net, I dont know how to use the DataGridView with Stored procedures to Display, INSERT, UPDATE & Delete data through Coding.
Your help will be appreciated.
|
|
|
|
|
If you've completed the DAL, what's with the question, since everything you're asking should be already be in the DAL?? You don't use stored procedures with the DataGridView. You bind it to a database source, such a a DataSet, DataTable, ..., some custom collection you've written.
|
|
|
|
|
Thank you for the prompt answer. But, do I have to use databinding or have I got to pass all individual datagridview columns as parameters to the DAL via BLL (I am new pls). I just need some eg as to how to pass the data to DAL via BLL from DGV. I have already done this to textbox controls on forms, but does not know how to do this with DGV. Does each new record has to be passed or the entire dataset can be synchronised to the DAL.
modified on Tuesday, November 11, 2008 9:01 PM
|
|
|
|
|
|
When I run the windows application, sometimes I get such error message
"The CLR has been unable to transition from COM context 0x1a6fd8 to COM context 0x1a6e68 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations."
Can I know why such error message we get?
Regards,
John.L.Ponratnam
|
|
|
|
|
You may have a long running process in which .Net displays a error from the debugging assistants.
Press CTRL+ALT+E to open the Exception options. I think this error is the Managed Debugging Assistants - ContextSwitchDeadlock. Try unchecking that setting and retrying the app.
Did this work for you?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
modified on Tuesday, November 11, 2008 7:57 AM
|
|
|
|
|
Greetings:
I am a systems administrator with absolutely no experience with coding. My interest is in the coding between bluetooth headsets and devices such as cell phones. I have Visual Studio 2005 professional edition... unopened. I write to inquire:
- What are the prevailing coding platforms for headset to device communicatons?
- Are there free and available coding modules in the language of Visual Studio that would facilitate headset to device communications?
- What on this site would facilitate my learning curve with regard to coding and the general scope of headset to device communications?
Much thanks for your attention as I await your reply.
|
|
|
|