Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Windows Forms GUI App to Windows App

Windows Forms GUI App to Windows App

Scheduled Pinned Locked Moved C#
winformshelpquestiondiscussion
4 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VK Cadec
    wrote on last edited by
    #1

    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.

    S 1 Reply Last reply
    0
    • V VK Cadec

      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.

      S Offline
      S Offline
      Scott Dorman
      wrote on last edited by
      #2

      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 the onLoad 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

      V 1 Reply Last reply
      0
      • S Scott Dorman

        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 the onLoad 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

        V Offline
        V Offline
        VK Cadec
        wrote on last edited by
        #3

        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.

        S 1 Reply Last reply
        0
        • V VK Cadec

          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.

          S Offline
          S Offline
          Scott Dorman
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups