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. Managed C++/CLI
  4. More Than One Operator "+" Matches These Operands

More Than One Operator "+" Matches These Operands

Scheduled Pinned Locked Moved Managed C++/CLI
c++help
5 Posts 2 Posters 0 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.
  • P Offline
    P Offline
    Paramu1973
    wrote on last edited by
    #1

    Hi, I have a small project in vc++ 2015. While I calculate the total, I get this error. Is it possible to solve this error. Any Kind helps.

    private: static System::Decimal MyNumber2;
    private: static System::Decimal DJSubTot = 0;
    private: static System::Decimal DJVATTot = 0;
    private: static System::Decimal DJFreightTot = 0;

    MyNumber2 = 0;
    if(Decimal::TryParse(textBox8->Text->Trim(), MyNumber2)){
    DJVATTot = MyNumber2;
    }
    MyNumber2 = 0;
    if (Decimal::TryParse(textBox9->Text->Trim(), MyNumber2)) {
    if (MyNumber2>0) {
    DJFreightTot = MyNumber2;
    }
    }
    textBox10->Text = (DJSubTot + DJVATTot + DJFreightTot).ToString();

    Thanks for the helps

    L 1 Reply Last reply
    0
    • P Paramu1973

      Hi, I have a small project in vc++ 2015. While I calculate the total, I get this error. Is it possible to solve this error. Any Kind helps.

      private: static System::Decimal MyNumber2;
      private: static System::Decimal DJSubTot = 0;
      private: static System::Decimal DJVATTot = 0;
      private: static System::Decimal DJFreightTot = 0;

      MyNumber2 = 0;
      if(Decimal::TryParse(textBox8->Text->Trim(), MyNumber2)){
      DJVATTot = MyNumber2;
      }
      MyNumber2 = 0;
      if (Decimal::TryParse(textBox9->Text->Trim(), MyNumber2)) {
      if (MyNumber2>0) {
      DJFreightTot = MyNumber2;
      }
      }
      textBox10->Text = (DJSubTot + DJVATTot + DJFreightTot).ToString();

      Thanks for the helps

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I don't have C++/CLI, but converting that code to C# it works fine. Where does the error occur?

      P 1 Reply Last reply
      0
      • L Lost User

        I don't have C++/CLI, but converting that code to C# it works fine. Where does the error occur?

        P Offline
        P Offline
        Paramu1973
        wrote on last edited by
        #3

        Thank Richard

        textBox10->Text = (DJSubTot + DJVATTot + DJFreightTot).ToString();

        The above line Thank Again

        L 1 Reply Last reply
        0
        • P Paramu1973

          Thank Richard

          textBox10->Text = (DJSubTot + DJVATTot + DJFreightTot).ToString();

          The above line Thank Again

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I have had another look at the documentation and cannot see why the error occurs. As I already mentioned, I do not have C++/CLI (and don't want it) on my system, so cannot test it further.

          P 1 Reply Last reply
          0
          • L Lost User

            I have had another look at the documentation and cannot see why the error occurs. As I already mentioned, I do not have C++/CLI (and don't want it) on my system, so cannot test it further.

            P Offline
            P Offline
            Paramu1973
            wrote on last edited by
            #5

            It's ok Richard, Thank Again for reply The following code clears my error()

            textBox10->Text = Convert::ToString(Decimal::Add(Decimal::Add(DJSubTot, DJVATTot), DJFreightTot));

            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