How to decide the errors

hoh to decide the error C2039


Answer this question

How to decide the errors

  • jsndgrss

    Please include a complete reproducible small sample.

    What is txt1 & txt2 Also, which line is causing the error (line the error is firing on)

    In addition, include the exact error you are getting.

    Thanks,
      Ayman Shoukry
      VC++ Team

  • Modem56k

    ToDouble isn't a member of String: instead the Double class has a static member function called Parse which takes a String. For example:

    using namespace System;

    int main()
    {
       String^ str =
    "3.14"
    ;
       double
    d = Double::Parse(str);

       Console::WriteLine(
    "d = {0}"
    , d);
    }



  • WillReyn

    if i put 1 + 1.1 the result its 12, i dont understend wy ... where is the poin where come a more 0.1 the correct its 2.1 ...




  • Smth5ter

    ... Sorry but i have dificult to pass the exemple to a project type CLR Windows Form.

  • LaurentLDI

    sorry  the problem its a point, i use a point and not a ",".
    whats the command to open a other form


  • John Chen MS

    txt1 and txt2 are meskedtextbox, and the error it is in this lines:

    Number1 = txt1->Text->ToDouble;

    Number2 = txt2->Text->ToDouble(0);

    Error 1 error C2039: 'ToDouble' : is not a member of 'System::String'

    sorry my bad english



  • miguelito928

    I'm sorry but you're still not very clear: what exactly are you attempting to do What exactly is your input

    Note: Double::Parse cannot handle a string of the form "1 + 1.1" it can only handle valid floating-point constants.



  • Houman b

    {

    Double Number1, Number2, Result;

    Number1 = txt1->Text->ToDouble;

    Number2 = txt2->Text->ToDouble(0);

    Result = Number1 - Number2;

    txtr->Text = Result.ToString();

    }

    This is my code, and i dont now where is the error

    :(



  • SJN2K

    why the result its rounded
    double number have this format *.** correct

  • dto

    Take a look at http://msdn2.microsoft.com/library/fdwb3fd7(en-us,vs.80).aspx that explains when the error is triggered.

    If you think the error is fired while it is not expected, please post a small sample exhibiting the issue.

    Thanks,
      Ayman Shoukry
      VC++ Team

  • shep58029

    What's the input What's the output Please provide more details with your questions.

  • the guy who broke it

    What sort of problem

    Try this:

    Number1 = Double::Parse(txt1->Text);
    Number2 = Double::Parse(txt2->Text);



  • UncleHarpoon

    Do you mean how to open a new instance of an existing form or how to create a new form

  • Jasper Eenhoorn

    a exist...
    i have 2 forms, form1 and form2.
    in form1 i have a button, and when i click in this button, will open form2.
    whats the code to do this



  • How to decide the errors