Trigger A Function In Form-application From A Service
Feb 27, 2012
For a small project I need the possibility to "trigger" a function in a Window-form-application from a Service. So there are 2 program's. One is the visible Form application with textboxes and buttons and so on... The other is a sort of service program that runs on the Windows Service account.
Actually the second program is a command-line tool that gets fired by a PHP script from the Apache server. Because the command-line tool runs in another "environment" then the Windows-form-App, it is NOT possible to communicate (trigger) with both apps.
I know I have to use IPC (InterProcess Communication) and I have download the dozens of sample apps, but I still can't get it to work.
PLEASE can someone give me some sample code, or perhaps sample program(s) to help me out?
I think it's really easy to build what I want, but for me it's a no-go :-(
So for example it has to work like this:
PHP script (running at Apache server) runs a "console/service" app (already working) which "triggers" (via IPC) a already running Windows-Form-app (also already working app) that for example shows a MsgBox with the text in it that is sended by the "console/service" app.
View 3 Replies
ADVERTISEMENT
Feb 18, 2012
I have a main form that has a dynamically generated treeview and also a panel control. Depending on the selection made within the treeview the panel docks 1 of three diffrent usercontrols which are full sub forms(done for ease of modifing design of sub form rather than layering panels on top of panels).Upon button click withing usercontrol i wish to trigger event within main form.For example delete button wich then triggers to remove current selected node from treeview. code for 1 of three diffrent user controls
Dim ctrlQ As New QuoteUC(TrViewQuotation.SelectedNode)
PnlSubFormDock1.Controls.Add(ctrlQ)
Code for delete button for which i need to raise event.
If MsgBox("Are you sure you wish to delete this customer ?", vbYesNo, "Delete Record") = vbYes Then
Deletecustomer(n)
End If
View 5 Replies
Jan 18, 2011
I want the presence of a text file in a folder to trigger a printing software and print using a template I already designed..all this should be done as a serviced..i.e. in the background coz I don't want my users to know how I am printing.
View 1 Replies
Jul 14, 2011
i have a Windows service that is hosting a WCF service through net.tcp and this is working great. I have also created a WCF service application. I am trying to add the net.tcp service reference to the service application. Then I add it to the GAC that goes ok but if I try to RegAsm the WCF service application to allow it to be called from Server.CreateObject I get the error:
Warning: Type library exporter encountered a type that derives from a
generic class and is not marked as
[ClassInterface(ClassInterfaceType.None)]. Class interfaces cannot be
exposed for such types. Consider marking the type with
[ClassInterface(ClassInterfaceType.None)] and exposing an explicit
interface as the default interface to COM using the
ComDefaultInterface attribute.
It does not work. I have tried to call it through a class library but this does not work either as the end point is not set correctly.
View 1 Replies
May 13, 2010
If I have my cacheduration set to some value for my Web Service, is it possible to force the function to trigger?
View 2 Replies
May 31, 2012
Am displaying list of available documents in the data grid which are retrieved from the database. Once we click on a specific one then it will retrieve PDF document from the server and display it in the browser.Currently, if I click a document from the list in the datagrid then it will display the PDF file in a new browser. Here is the code for that :
ds.Tables(0).Rows(i).Item("DOC") = "<font color=blue onmouseover=""this.style.cursor='hand';"" title=""Click for PDF"" " + _
"onclick=""location.replace('index.aspx?Name=" & link & "')"">" & docNum & "</font>"
[code].....
View 1 Replies
Nov 8, 2010
I think I have a timing issue. On the trigger of an event I call a function to update a value:
Private Sub t0_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles t0.Click
Input.ppProperty = "blank"
UpdateRecord("Hey", Input.ppProperty)
MsgBox(Input.ppProperty)
End Sub
[Code] .....
Notice the difference, the property does not update until the function is completely finished.
Why?
View 2 Replies
Sep 7, 2009
I've got a textbox with a mousehover event and that event will only happen once and then I have to move my mouse out of the text box before it'll happen again. Is there a way to reset the mousehover event 'trigger' so that it happens as many times as I want?
View 7 Replies
May 3, 2012
one of the apps that I wrote a couple months ago is getting to be rolled out to my production floor; one issue tho - It works great as a standard executable (you double-click, it starts and waits for data), however, I cannot get it to start as a system service.
I've already done a little bit of research for how to create a system service, but most of the information that I've come across is point to VC# or Visual Studio 2010 - I'm not finding much for VB 2010. Additionally, I'm only using VB 2010 Express and I'm pretty sure that I don't have the Windows Service application template's on my PC.
My application does have a "UI", but there isn't any user interaction; it starts and just sits minimized in the system tray polling a directory for the existence of a file - i.e. the windows form is not required.
View 1 Replies
Jun 11, 2009
What should I do to trigger an application (wpf in vb.net) to look for updates?
View 5 Replies
Apr 28, 2009
This is a bit of unusual problem that I'm experiencing, but recently one of the users of a production application started reporting errors in the system. These were traced to a 503 Service Unavailable error when making a call to a web service used by the application.
Now here's the odd part, only the one user is affected by this issue. Other users of the application have not reported any errors. When the user logged on to a different machine that worked for another user, they still received the error.
View 1 Replies
Mar 15, 2012
Is it possible to reload a form of the running application from one computer when I executed a function from my other computer with the same application? co'z I want to see the changes of data on my datagrid view?
View 2 Replies
Oct 6, 2011
i have to develop a software for motorola mc9090 that reads barcodes and rfids simultaneously, so i need to catch two different triggers: the one on the keyboard for barcodes and the other in the backside for rfids.the problem is that i didn't find any sample that illustrates how to set the trigger to read only barcodes, i found something on emdk 2.5 samples that shows how to set the trigger to read rfids but nothing for barcodes. So when i press any trigger the barcode reader is always enabled with rfids reader.Does exist a way to manage them with separated triggers?
View 1 Replies
Sep 4, 2009
I'm not sure how I can trigger the button in the datagridview ?? it is quite different from the gridview in web development application.
View 2 Replies
Feb 19, 2012
I have this code in my ViewProductsInventory (which is called from my MainForm by ShowDialog):
Private Sub ViewProductsInventory_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Tb_inventory_datesTableAdapter.Fill(Me.InventorySysDataSet.tb_inventory_dates)
Dim inventory_date As Date
inventory_date = Me.cboInventoryDate.Text
[Code] .....
Upon clicking the editbutton will execute EditForm.ShowDialog()
And in my EditForm the record will be updated, after which will trigger ViewProductsInventory.btnSearch_Click( ViewProductsInventory.btnSearch, EventArgs.Empty)
And then the error "Conversion from string "" to type 'Date' is not valid" occurs.
I tried Msgbox(Me.cboInventoryDate.Text) and returns nothing. I'm assuming that my cboInventoryDate is not being populated at this time therefore when btnSearch_Click is triggered it receives nothing.
View 1 Replies
Feb 7, 2010
I successfully coded MyApplication_Startup and MyApplication_StartupNextInstance to give my single-instance application access to the command line. It works fine. if the application is not running and the user double clicks on a filetype associated with my application, my application starts up and reads in the file that was double clicked on. That's fine.
However, when the user double clicks on another file (same associated type) when the application is already running, I then (and only then) get a warning (from McAfee in my case) that my application is requesting access to the internet. I simply click OK to allow access, McAfee goes away, focus shifts to the original instance, and that instance successfully reads in the second file.
If the user then double clicks on a third file when the application is already running, focus shifts to the running application, it loads the third file, and the internet access warning DOES NOT appear. Same with all subsequent cases.
Any ideas about why the sudden internet access warning is occuring? In all the startup and load events, I do not do any internet related things. Much later, the program will send an email, but that code is far removed from Startup and Load things.My only idea is that perhaps because I have "awakened" the normally hidden ApplcationEvents.vb file (by putting some code in there), maybe I have triggered some sort of handling of the MyApplication_NetworkAvaialabilityChanged event, even though I make no reference to this event anywhere.
Before I added the command line handling stuff, I noticed that the internet access warning would occur only once for each new build. Susequent execution of the same build would not trigger an internet access warning. So now it is as if the handling of the StartupNextInstance event is simulating starting up a new build for the first time. Weird.
One more thing. I am not deploying this over a network. I am making a simple .exe by selecting Build from the MVS 2008 menu, then running the .exe by double clicking on it from Windows Explorer. I am using Visual Basic 2008 Express on Windows XP.
View 1 Replies
Feb 18, 2012
i have a little problem in calling the button1_click event of form1 from my form2.whenever i use call form1.button1_click() it gives me an error saying argument not specified for parameter 'e'. can anyone please assist me on fixing this?
View 2 Replies
Apr 25, 2012
I would like to be able to fire/trigger an event when the form is no longer the top most window (ie the window that is on top of all other windows), and then close the form with me.close()
View 5 Replies
Apr 12, 2009
i'm trying to trigger control events from outside the form that the control is placed. The idea is test of that control.
How this can be done.
For example I'm trying this
Private Sub SendGenData(ByVal ContName As String)
Dim testControl As Control
For Each testControl In Me.Owner.Controls
[Code]....
View 9 Replies
Dec 18, 2010
I've been playing with VB.NET for a couple days now, and I was looking into key input controls, now I've managed to have it react to keyboard buttons being pushed inside the main form (wasn't hard), where it counts total amount of keys pushed, not what keys are pushed etc.
What I'm having a harder time is finding a way to have this same functionality even if the form isn't active (for example when minimized to the system tray). I did find a similar question on these boards, but it was regarding hotkeys and that user was just referenced to the hotkey API, which is not what I am aiming for.
View 2 Replies
Mar 26, 2010
I am creating a form and I have a label that will display the user's name, but what I need to do it trigger a text box when the application opens that will allow the user to type in their name and then assign that value to the label in my form. How do I trigger the text box and assign the value to my label? My label is named lblStudent.
View 11 Replies
Apr 11, 2012
I'm trying to trigger when the mouse leaves the form, but I don't want to trigger the mouseleave when its over controls; as it is doing at the moment. Can you suggest ways to keep triggering the mousehover over form while on controls? but mouseleave works still when the mouse leaves the form (not when hovering controls) ?
View 1 Replies
Mar 8, 2012
I have one form (FormA) that fills a combobox with data when the on-load event is trigged.In that combobox, I can select "New value" which opens another form (FormB) on top of FormA.On FormB I add the new data and saves them to a Database.Everything OK till here.I then close FormB.... and return my attention back to FormA.Now I would like to reload data into the combobox, but everyway I have tried, it will not work.
View 5 Replies
May 19, 2010
Can Windows Form Trigger when a control has been modify or not ? I mean i have 3 panel and inside of those panel have a textbox, how am i able to find whether some of the textbox where modified in a specific panel? i.e panel 3 textbox2 has been modify i want that i have a notification that panel3 textbox were modified
View 1 Replies
Apr 23, 2009
how to trigger a refresh on a form when an update occurs in my business logic.
This isn't an issue for 95% of my forms because they call the update from the form that needs to be updated. However, In some cases an inner form does and update that requires an outer form to reflect this. I've read about Handles, Delegates, AddressOf etc etc and I'm drowning in options.
In simple terms, I need three things to happen
1. Form2 (inner form) has updated info, so the user clicks Save
2. Save calls my Data Access Layer and updates the database
3. Form1 (outer form) has a DataGrid that needs to be notified so it can update via a Sub LoadGrid
It's stage 3 I can't do. How do I trigger a Sub in Form2 (LoadGrid) to do the refresh from an external class.
View 1 Replies
Sep 1, 2009
I have a WCF Service Function that Returns a typed dataset. How can I return an error or message to the client?Public Function ReturnMyDS(Byval Identity as Integer) as dsMyDataSet Implements Iservice.ReturnMyDS
Try
Return = RetrievemyDataset
Catch ex as exception
[code]...
View 1 Replies
Sep 24, 2010
I have a windows app that references a web service I created. In the web service, I created a function that needed to return more than one value. Because of this, I created a public structure in the web service:
Public Structure MyRecordSet
Public lstOfDataInRecord As List(Of String)
Public iNumberOfRecords As Integer
End Structure
Here's the function - the return value is MyNewRecordSet:
Dim MyNewRecordSet As MyRecordSet <WebMethod()> _
Public Function GetDataReturnList(ByVal sql As String, ByVal sTableName As String) As MyRecordSet
MyNewRecordSet.lstOfDataInRecord = New List(Of String)
[Code] .....
Anyway, I see it's a conversion issue, but not sure how to resolve it. This is my first attempt to use a public structure in a web service and receive a return on it from my app.
View 1 Replies
Feb 11, 2009
This same (Identical ) code works well in another program but does not in windows service... Returns 0 for window handle ...?
Public WindowStr As String = "ImagSrvWindow"
Protected Overrides Sub OnStart(ByVal args() As String)
'necessary to get control to paint Pic&Txt boxes in stream of Browser navs
[Code].....
View 7 Replies
Aug 4, 2011
I have a specific problem that I have not yet found an answer to. Basically I need to pass a list of numbers into a function do some math and return them. I can pass one number at a time without a problem, however when I want to pass in an array I start to have issues. My VB.net code looks like this...
[Code]...
View 1 Replies
May 23, 2011
I have a WCF Service exposing a single contract and operation:
<ServiceContract(Namespace:="ImageSystem")> _
Public Interface IUploadService
<OperationContract()> _
[Code].....
This subsequently leads to stream casting issues, because the generated function allows me to pass a memory stream as an input (which works correctly when passed through to the service), but instead of passing me back a new stream for the response, it attempts to cast the MessageBodyStream received from the service into my memory stream.
This is, in some ways similar to other posts but as you can see, there are no enums involved in my contracts - presence of Enums caused strange proxy class generation is marked as the answer in the similar post.
Is there anywhere I configure the proxy behaviour to use the contracts I've specified? Clearly I'm within a dev/test environment currently, but when this eventually goes to production it will be memory and file streams passed to the service, and the returned stream can be in any format to be honest, I intend to treat it as the abstract stream class. The only way round this I can see right now is to change my in stream to be the same as the anticipated out stream, but surely there is a better way?
View 1 Replies