Results 1 to 5 of 5

Thread: [RESOLVED] App loading issue

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2017
    Posts
    104

    Resolved [RESOLVED] App loading issue

    Dear guys!!

    Again stuck!!

    So here it is: I have an app that needs to communicate with 2 Serial ports. And the info (COMa,COMb) comes from a config file, which COM port is for what purpose. The reason is to make a universal app, so depending on PC to PC, it will run simply.

    What I did:

    1) there is a conf file which already keeps the info (as I know).
    2) the app loads the info and initiates a connection [serial.open].
    3) The p continues to do its work.

    Now, it has a config window that it uses for config settings.

    Where I'm stuck:

    1) If there is no conf file/if there is no info in file (say fresh install) then it fails to load at all [means i need some exception handling to pass it away.]
    2) If the COM ports are not available in real, then the app is getting hang, and there I again need another exception handling to pass it away.

    Last Note: I prefer to pass it away as then I can enter into the config window for config and that will eventually generate the conf file.

    Ideas??

    Mishu~

  2. #2
    Frenzied Member
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,148

    Re: App loading issue

    You can check the configuration file for default values before initializing the com ports.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2017
    Posts
    104

    Re: App loading issue

    Quote Originally Posted by aashish_9601 View Post
    You can check the configuration file for default values before initializing the com ports.
    Putting the default values is not a big deal and already done that. But say, if default val is COM1 and COM2 but in practical, they are not available, then app is not working, the splashscreen is UP and then main window is not coming. I want is, say if default value is not helping to connect the COM port, then it should just avoid and do nothing or it can put me to the conf window. Now it's just "hang" and doing nothing.

    some exception handling type of thing...

  4. #4
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,597

    Re: App loading issue

    I haven't check that but I do not see why it souldn't have the needed data:
    You can use WMI to check the available COM ports and compare them to the config ports.
    If they are not there then, do something.
    This can be done once when the application install and write the ports somewhere in a config file, so it does not have to run WMI check every time. If some hardware is changed then, yes you will get an exception, then you will have to use WMI once more and get the new ports and write them somewhere for future usage.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  5. #5

    Thread Starter
    Lively Member
    Join Date
    May 2017
    Posts
    104

    Re: App loading issue

    Quote Originally Posted by sapator View Post
    I haven't check that but I do not see why it souldn't have the needed data:
    You can use WMI to check the available COM ports and compare them to the config ports.
    If they are not there then, do something.
    This can be done once when the application install and write the ports somewhere in a config file, so it does not have to run WMI check every time. If some hardware is changed then, yes you will get an exception, then you will have to use WMI once more and get the new ports and write them somewhere for future usage.
    How to make a conf file during the install time?? I dont know that...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width