1. Black Friday Sale - 50% off

    B4A Standard for $29 instead of $59!
    Buy Now
    Dismiss Notice

Bug - Optomized Compile Generates Error

Discussion in 'Bug Reports' started by epsharp, Jul 13, 2011.

  1. epsharp

    epsharp Member Licensed User

    The attached works on W98, W2K, Server 2000/2003 and Windows 7 in debug mode.

    After compiling, it works on all O/S`s EXCEPT Windows 7.

    This is just a code snippet; it is normally part of a security check routine to identify the Workstation and the User that is trying to execute the program. I didn't know there was a problem until I recently got a new laptop (W7), ported all development work to laptop and found out that no .exe files would run. It doesn't matter if you compile the program on the W7 machine or any other; the .exe file just bombs.

    The registry fetch works, the Computer Name (Sec_Svr) is correct and the error occurs when trying to test (or msgbox or anything else) on what should be the User Name (Sec_User). Work around is to use ErrorLabel.

    Regards,

    Ed Sharp
     

    Attached Files:

    • Test.sbp
      File size:
      553 bytes
      Views:
      156
  2. Erel

    Erel Administrator Staff Member Licensed User

    Which error do you get?
     
  3. agraham

    agraham Expert Licensed User

    It doesn't work on Vista either. The reason is that Registry.GetString returns Null in a compiled program if the entry is missing so your StrLength throws an exception. You can check for this.
    Code:
    If IsNull(Sec_User) OR StrLength(Sec_User) = 0 Then Msgbox("No User")
    This works because of short-circuit evaluation on the If condition. If IsNull returns True then the StrLength function is not evaluated.
     
  4. epsharp

    epsharp Member Licensed User

    Error Message

    To Erel,

    Error message is attached.


    To Agraham,

    Thank you for the information.


    As always, great, great support.


    Regards,

    Ed Sharp
     

    Attached Files:

  5. RacingDog

    RacingDog Active Member Licensed User

    I also have W7. So when can we expect a version which works on W7?
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    The above issue is not related to Windows 7 which is fully supported.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice