CS0246 CEnhancedCheckbox compile error

Discussion in 'Bug Reports' started by RichardW, Jun 16, 2009.

  1. RichardW

    RichardW Member Licensed User

    Updated to 6.80 and encountered one glitch when compiling myQuotes.sbp for windows (optimized). I get "external compiler error CS0246 the type or namespace 'CEnhancedCheckbox' could not be found".

    This occurs for CEnhancedCheckbox and for CEnhancedRadioBtn.

    The error does not occur when compiling for the device.

    I can get around this my changing the offending from:

    Case "checkbox": Control(ary1(1), checkbox).text = ary1(2)
    Case "radiobtn": Control(ary1(1), RadioBtn).text = ary1(2)
    Case "checkbox": Control(ary1(1)).text = ary1(2)
    Case "radiobtn": Control(ary1(1)).text = ary1(2)
  2. agraham

    agraham Expert Licensed User

    I can't reproduce error that from the information given. Can you post an actual sbp that displays this behaviour?
  3. RichardW

    RichardW Member Licensed User

    CS0246 error sample sbp

    Here is an example. I just tried to compile it for Windows with optimized on and I get the 2 errors for "checkbox" and "radiobtn".
  4. agraham

    agraham Expert Licensed User

    It's a compile time reference problem. Presumably Erel has "enhanced" something in the optimising compiler in version 6.80 as you imply it compiled in version 6.50. As your project seems to not have either a CheckBox nor a RadioBtn control the optimising compiler is not adding the code for them but is trying to reference that missing code in the Control statement. If you add both a CheckBox and a RadioBtn to your Form1 the problem goes away.

    Over to you Erel - :)
  5. RichardW

    RichardW Member Licensed User

    Thanks for the explanation.

    It never occurred to me that the absence of a control(s) could result in confusion to the compiler.

    This code is part of my generic language subroutine which is meant to read a text file and update the indicated controls' text display. As you noted myQuotes does not use checkboxes or radio buttons.
  6. Erel

    Erel Administrator Staff Member Licensed User

    As agraham wrote, the optimized compiler doesn't add code for control types which are not used.
    If you don't add a checkbox with the designer or with AddCheckBox keyword then there is no way that such a control will exist during runtime. So the compiler doesn't add the unnesseccary code.
    I didn't check it but I guess that this code will also fail in V6.50.
  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