Windows Forms GUI App to Windows App
-
Hi, I have a windows forms GUI app which I would like to convert to run sliently. The forms app has three input variables, which I have now put in a .config file. Now, within the main program, I would like to call a module - it keeps coming back with error message. within main - module - processXML(_source); module definition: public void processXML(string _source) error: Error 1 An object reference is required for the nonstatic field, method, or property 'convertXML.onLoad.processXML(string)' Any thoughts? Many thanks.
-
Hi, I have a windows forms GUI app which I would like to convert to run sliently. The forms app has three input variables, which I have now put in a .config file. Now, within the main program, I would like to call a module - it keeps coming back with error message. within main - module - processXML(_source); module definition: public void processXML(string _source) error: Error 1 An object reference is required for the nonstatic field, method, or property 'convertXML.onLoad.processXML(string)' Any thoughts? Many thanks.
This really needs more information, but making a couple of assumptions: 1. convertXML is your main form 2. onLoad is an event handler for the Form's Load event Based on these assumptions, you can't write code like:
convertXML.onLoad.processXML(string)
You would need to call your
processXML
method from inside theonLoad
method. A few other things...you really should adjust your naming conventions to follow the de-facto standard of camel casing. This would change your names to "ConvertXml", "OnLoad", and "ProcessXml". Also, what is the intention of running this "silently"? Is this a process that is always supposed to be running in the background? If that is the case, you should think about converting this to run as a Windows service.----------------------------- In just two days, tomorrow will be yesterday. http://geekswithblogs.net/sdorman
-
This really needs more information, but making a couple of assumptions: 1. convertXML is your main form 2. onLoad is an event handler for the Form's Load event Based on these assumptions, you can't write code like:
convertXML.onLoad.processXML(string)
You would need to call your
processXML
method from inside theonLoad
method. A few other things...you really should adjust your naming conventions to follow the de-facto standard of camel casing. This would change your names to "ConvertXml", "OnLoad", and "ProcessXml". Also, what is the intention of running this "silently"? Is this a process that is always supposed to be running in the background? If that is the case, you should think about converting this to run as a Windows service.----------------------------- In just two days, tomorrow will be yesterday. http://geekswithblogs.net/sdorman
I need to then schedule this out on a windows scheduler to automate this whole process. I cannot put this windows gui app in scheduler since it would require human interaction to enter those three input variables. you are right about the assumptions. Thanks - will try what you mentioned.
-
I need to then schedule this out on a windows scheduler to automate this whole process. I cannot put this windows gui app in scheduler since it would require human interaction to enter those three input variables. you are right about the assumptions. Thanks - will try what you mentioned.
In that case, putting them in a config file or being able to accept them as command line parameters would be the right way to go.
----------------------------- In just two days, tomorrow will be yesterday. http://geekswithblogs.net/sdorman