|
Hi,
I would like to use the FileSystemWatcher to run and external command if a file is renamed. For example, if a file is renamed to *.__old the file is copied to a new location.
So far I was able to make it work for 1 or 2 simultanious changes but there could be potentially 50 to 100 changes at the same time and it appears that there is a timeout waiting on the first command to execute.
Could someone tell me how I could get the FileWatcher to handle multiple commands at the same time?
Thanks....
|
|
|
|
|
Perhaps your event handler should start a new process for each change and use an asynchronous callback to let the FileSystemWatcher process know that it's done?
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
Howdy my friends!
I have been developing Pocket PC solution for SAP R/3. But, I faced a problem with web service on VB.NET 2003. My problem is, return parameters are set to "nothing", when I try to invoke web method from VB.NET. Actually, the SOAP response message recieves by client without a problem. I can see the response SOAP message by MS SOAP Trace tool. But Invoke method cannot parse it anyway. As a result i can't get any return value. What's lying behind of it?
My sample code as below;
' Set RFC parameters
Dim strPrm1 As String
Dim strPrm2 As String
' Set URL
Dim sURL As String
sURL = "http://ybpent:8000/sap/bc/soap/rfc?sap-client=274"
' Set credentials
Dim m_Credentials As ICredentials
m_Credentials = New NetworkCredential("xxxxx", "xxxxx")
' Set web service
Dim m_RfcClientInfoYBT As New dNETSOAP4SAPR3.RfcClientInfoYBT.RFC_CLIENT_INFOService
m_RfcClientInfoYBT.Url = sURL
m_RfcClientInfoYBT.Credentials = m_Credentials
' Call web service
m_RfcClientInfoYBT.RFC_CLIENT_INFO(strPrm1, strPrm2)
Proxy method as below;
'<remarks/>
<System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.sap.com/RFC_CLIENT_INFO", RequestNamespace:="urn:sap-com:document:sap:rfc:functions", ResponseNamespace:="urn:sap-com:document:sap:rfc:functions", Use:=System.Web.Services.Description.SoapBindingUse.Default, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)> _
Public Function RFC_CLIENT_INFO(<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> ByRef HOSTNAME As String, <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> ByRef SYSID As String) As <System.Xml.Serialization.XmlElementAttribute("HOSTID", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> String
Dim results() As Object = Me.Invoke("RFC_CLIENT_INFO", New Object(-1) {})
HOSTNAME = CType(results(1), String)
SYSID = CType(results(2), String)
Return CType(results(0), String)
End Function
Anybody has an idea about it?
Thanks.
Orkun GEDiK
|
|
|
|
|
Hi,,,
How shud i retrieve the Mapped Drives and also All the Computers in Network in Vb.net.
thanks
Tasnim
|
|
|
|
|
Part, possibly all, of the answer may be found in this[^] article here on CP, about using Windows Management Instrumentation.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
I was trying to write data in the event log. I found these lines of code somewhere:
Dim bRC As Boolean
Dim iNumStrings As Integer
Dim hEventLog As Long
Dim hMsgs As Long
Dim cbStringSize As Long
Dim iEventID As Integer
Dim sMessage As String
Dim sSource As String
sSource = "ErrLog"
sMessage = "Success Message"
hEventLog = RegisterEventSource("", sSource)
cbStringSize = Len(sMessage) + 1
hMsgs = GlobalAlloc(&H40, cbStringSize)
CopyMemory ByVal hMsgs, ByVal sMessage, cbStringSize
iNumStrings = 1
If ReportEvent(hEventLog, _
EVENTLOG_SUCCESS, 0, _
EBALOG_SUCCESS, 0&, _
iNumStrings, cbStringSize, _
hMsgs, hMsgs) = 0 Then
MsgBox "FAILED"
Else
'-- Sucessful
MsgBox "Success"
End If
Call GlobalFree(hMsgs)
DeregisterEventSource (hEventLog)
But it doesn't work, The function always returns 0. And it doesn't write anything on the log.
please help.
SDE
|
|
|
|
|
The return value is zero because there was a failure. Use GetLastError to get the error number, then look that up here[^]. This is the System Error Codes list on MSDN.
You might want to check the value returned by RegisterEventSource first. It looks like your not getting a good EventLog handle returned here. Your passing in an empty string instead of a 0 (which means NULL). This is where I think your problem is. If you change the call to this, it might work:
hEventLog = RegisterEventSource("." & chr$(0), sSource)
Again, if you get back a zero for either RegisterEventSource or ReportEvent, then use GetLastError to find out what the error was.
RageInTheMachine9532
|
|
|
|
|
hi,,,
I want to pass a value in a formula field in my report(Crystal Report 9) through Front-End. I am using CrystalReportViewer. Like in Vb 6.0 we used to write
CrystalReport1.formulafields.item("formulaname").text = FormulaValue
How to do this using vb.net and Crystalreportviewer???
thx
Tasnim
|
|
|
|
|
Something quite similar:
Dim rd As New ReportDocument
rd.Load("c:\MyReport.rpt")
rd.DataDefinition.FormulaFields.Item("FieldName").Text = "..."
crv.ReportSource = rd
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
Thanks for your reply, But I am not using any Report Document. I have Crystal Report Viwer object on a form, and i am passing the reportsource through another form. My code is as below.
Dim frm As New frm_reportviewer() ''' form which contains crviewer
frm.CrViewer.ReportSource = Application.StartupPath & "\reports\rep_EFileStatusReport.rpt"
frm.Show()
What is the property of CrViewer to pass FormulaFields??? I am not getting it?
thanks
Tasnim
|
|
|
|
|
With a little research, it looks like your going to have to use a ReportDocument in order to do what you want. You create a ReportDocument using the code in the previous post, then pass the document to the CrystalReportViewer.ReportSource property so it can be viewed.
Read the example given a little closer and you'll find your solution.
RageInTheMachine9532
|
|
|
|
|
Yeah, what Dave said. You're not using the ReportDocument object, but you need to in order to access the FormulaFields collection.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
:-DI've seen code using c# to input/output using whether serial or I/O card. But still I can't find any of it in VB especially in VB 6. Can you guys give me any tutorials or websites or maybe an example by using VB 6
|
|
|
|
|
I've used this[^] library before. It's pretty good and gives you all the control you want.
RageInTheMachine9532
|
|
|
|
|
First, sorry for reposting this again (previous post)[^], however I have had not much luck researching this one, so I just want to ask for tips/hints on this matter.
The problem:
I need to set the stapling capability of a printer before printing a document (in a Word global template, i.e. VBA code).
I have found an API to set printer duplexing, which unfortunately does not include setting the stapling.
I've had a look at PDL (Page Description Language) but I find that it will be too complex to put the PDL command on top of the document file before printing it out.
If anyone has ever done this before can you please inform me on how to set printer stapling?
Thanks,
Edbert P.
Edbert P.
Sydney, Australia.
|
|
|
|
|
I can't find a single code example (in any language) that even comes close to what you want. The only example I could find is buried inside driver code, which won't help you because your not doing the actual job assembly and printing.
There are a couple of problems:
1. You need to set the stapling in PageSetup of the document before it is printed. This will not be accomplished using the API calls. What you've been looking at is setting the default for the printer for ALL documents being printed by ALL applications.
2. Since not all printers support stapling and the ones that do require you to send different data structures to enable stapling, coding this is going to be a GIANT pain.
If your doing this as a document template, you should be able to start a document, using the printer with stapling as the default printer, go into PageSetup and set everything you need to, including stapling, then setup your documents properties the way you want, then just save the template as a .DOT file. When you create a document using that template, stapling SHOULD be enabled, and not if the printer doesn't support it.
The above has NOT been tested since I don't have access to ANY printers that support stapling (rare, but cool, beasts that they are.)
RageInTheMachine9532
|
|
|
|
|
Thanks a lot for the effort (and the explanation)
I will continue searching for this and if I find anything I will post it for everyone.
Edbert P.
Sydney, Australia.
|
|
|
|
|
Has anyone seen controls/code that produces the sort of functionality provided by the "To:" text box on an Email message? In other words - clicking a button brings up a list of items to select from, one or more items are selected and appear in the text box, double-clicking one takes you back to the relevant item in whatever data source you're using, but after an event (send or whatever) the relevant data is then copied elsewhere (to the Email item or elsewhere).
|
|
|
|
|
After much searching, I haven't seen any controls that do everything you describe. Not even half of what you want, actually...
If I were in your shoes, I would write the thing myself...
RageInTheMachine9532
|
|
|
|
|
I set the form1.moveable = false when designing. But I want that the form1 could move in running. Therefore I set the form1.moveable=true in a button click events. However it cannot be done. It shows that the .moveable is readonly and cannot be changed while running. How can I make a form moveable in running while be set to unmoveable in designing?
Thanks!
|
|
|
|
|
I have to question why this would be an issue? From what I can tell, the Moveable property has no effect at design time, only at runtime. The form in the designer is locked to the upper left corner of its document window, regardless of this property. Also, you can change the position of the form using the Top and Left properties, even when Moveable is false. I don't see how that window is moveable during design-time...
RageInTheMachine9532
|
|
|
|
|
Please tell me how to use CallByName function in VB.NET.
Thanks,
|
|
|
|
|
CallByName lets you call a Function or manipulate a Property on an object, such as a TextBox or other class:
CallByName(TextBox1, "Text", CallType.Set, "New Text")
CallByName(TextBox1, "Hide", CallType.Method)
Dim col As New Collection()
' Store the string "Item One" in a collection by
' calling the Add method.
CallByName(col, "Add", CallType.Method, "Item One")
' Retrieve the first entry from the collection using the
' Item property and display it using MsgBox().
MsgBox(CallByName(col, "Item", CallType.Get, 1))
The down side to using the CallByName function is that it is very slow. There is also no type checking of arguments, so handling errors properly becomes a bit of a pain.
RageInTheMachine9532
|
|
|
|
|
(1) How can I code a text box to accept characters of the alphabet, a spacebar (and a - for double barrel names) only? Ideally this text box is named txtName and is supposed to accept people’s names.
(2) In VB. NET how can I create a library of common procedures that I will constantly need to copy and paste to different projects
Been always great to be part of this forum, especially when I know they know more than what I know…..
|
|
|
|
|
bensoncd wrote:
How can I code a text box to accept characters of the alphabet, a spacebar (and a - for double barrel names) only? Ideally this text box is named txtName and is supposed to accept people’s names.
You could run a regular expression on the contents of the textbox changing, and disable the OK button (or whatever) until the expression matches.
bensoncd wrote:
(2) In VB. NET how can I create a library of common procedures that I will constantly need to copy and paste to different projects
Try creating a Class Library project. This allows you to create a .NET assembly (held in a DLL) that can contain your common code base.
Ian Darling
"One of the few systems...which has had “no deaths” in the reliability requirements." - Michael Platt
|
|
|
|
|