|
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
|
|
|
|
|
OnPaint is an event that the control responds to. Paint is the method that the control uses to paint itself. The control itself shouldn't be firing off an OnPaint event.
Like Christin asked, do you have the source for this control? And are you creating your own version of this control?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank you Dave.
I'm using a suite of free controls downloaded from www.Softwire.com. There are very interesting things there. You can use this controls programmaticaly or graphicaly connecting one to each other.
I'm using it programmaticaly for example
Dim WithEvents myStripChar as new Softwire.VI.Stripchart
...
For i=0 to 100
myStripChart.value = i
myStripChart.Operate()
Next
That's all code necesary to run something basic.
So, I wanted modify it adding a vertical line to the control and I thought to do it overwithing the OnPaint event, But it never happened.
Thanks a lot
german
|
|
|
|
|
Does any one have code examples of implementing the IBindStatusCallback class / methods of URLMON URLDownloadToFile API call?
Thanks
Jack
Thanks
Jack
|
|
|
|
|
I'm trying to write my own save dialog (to replace the one in word 2003) but I'm unsure of how to go about it. I haven't found very much information about this topic on the internet so I'd be grateful for any information...
/jason
|
|
|
|
|
You can't "hook" the dialog and really can't replace it. Why do you want to change the Save dialog in Word?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I want to intercept the message calling the Save Dialog and instead, open my own. Is this really an impossibility? The reason I am doing this is that I'm involved in a document management system and we want to prevent the user from doing certain things and allow them to do others.
/jason
|
|
|
|
|
This is not impossible by any means, at least not up through Word 2002 anyway. I know nothing about Word 2003 but I would assume it still supports Automation.
I have written something similar to what you describe - basically a document management type of application. We had documents that were stored on a remote server, users opened documents from a web page, and edited them using their local Word instance. Then we needed to trap the user save events in order to preserve the document names as well as launch an FTP transfer to automatically send the modified document back to the remote server.
Basically what you have to do is get the active instance of Word, and then sink the events in your application.
Word fires a DocumentBeforeSave event when the user attempts to save the document. If you set the SaveAsUI property to false in this event, it will suppress the Word Save Dialog. Then you add your custom code to control how the document is saved.
That part is simple enough.
There are some caveats:
1) If you always launch Word from your document control application, then you always have the reference and can sink events. But depending on your system, you may have to account for the possibility of a user launching Word itself then editing a controlled document. So your application may need to run all the time, and poll the system frequently to see if Word has been launched externally.
2) Again depending on your system, it may be possible for people to circumvent your controlled environment by copying/and or renaming controlled documents outside of Word - i.e using Windows Explorer. Obviously if you need to save a doc, users will have read/write access. So you cannot easily enforce this by file system permissions.
You can trap this by using another feature of Word Automation object model. Documents provide a generic Variables collection. You can create your own variables that you can control by your code. For example, suppose you need to prevent a user from copying a document from Windows Explorer into a new file name and then editing it in Word. Embed the document name in a custom Document.Variable. When the user opens a document, you compare the file name to the embedded name, and if they don't match, act as you deem fit - i.e forcibly rename the document, close it as "corrupt", whatever.
3) This is MOST important: People use Word for a variety of reasons, and it is almost certain that only some documents will actually fall within the scope of your document control system. (A private memo to Personnel, for example, is after all private and not only do you probably not want such docs to find their way into your managed document group, it could potentially result in a lawsuit. Plus in this mercernarial world we live in, should people really be prevented from polishing up their resume on their lunch hour? LOL!! I don't think so...
With an ubiquitous application like Word, you definitely need a way to determine if any given document is not part of your managed collection. In which case, your custom code should not run, but rather should allow the standard Word functionality to be re-established.
You accomplish this also by use of embedded variables. You sink the events for all documents, but you should check for the presence or absence of some custom embedded variable in the document to differentiate between a managed document versus an unmanged document, and run or abort your custom actions accordingly.
4) etc etc..
To make a long story short, tapping into the Word interfaces and implementing a custom save action is not the difficult task.
Making sure that your system reliably manages documents which require management, and not only ignores but also does not interfere at all with documents that are not part of a managed group is the real chore.
Designing an effective system will require some thought, and quite a bit of testing as well. Users can be very unpredictable...
Hope this helps,
Robert
|
|
|
|
|
I think I'll bow out of this one gracefully!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
This is what I'm talking about! Thanks for this Robert, it helped organise our thoughts on this process. What we have decided to do is implement an activeX control that hides the existing save button, and display our own in it's place, while leaving the Save As button in place. Our save button then saves the document to our DMS while the Save As button allows them to save documents with the usual interface. We're happy enough with this solution because it allows us to use the same ActiveX control for the Office Suite (Word, Excel, Powerpoint and Visio)
Thanks for your tips
/jason
|
|
|
|
|
|
Hi. i wanna create my component. how i can this. please help me.
|
|
|
|
|
Black magic.
If you want a different answer, try telling us what it is you're trying to do.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|