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. Int64 minus....

Int64 minus....

Scheduled Pinned Locked Moved Managed C++/CLI
c++databasehelpquestion
3 Posts 3 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.
  • T Offline
    T Offline
    Thilek
    wrote on last edited by
    #1

    Hi guys, I have a question ya... minus a int64 with another int64.. below is my coding :-

    System::Int64^ limit1;
    System::Int64^ limit2;
    System::Int64^ diff;
    
       diff = limit1-limit2;
    

    the limit1 and limit2 values are the count of the records in a database. but the diff-limit1-limit2; is not working. i am new to managed c++.kindly help me... Regards, Thilek

    M D 2 Replies Last reply
    0
    • T Thilek

      Hi guys, I have a question ya... minus a int64 with another int64.. below is my coding :-

      System::Int64^ limit1;
      System::Int64^ limit2;
      System::Int64^ diff;
      
         diff = limit1-limit2;
      

      the limit1 and limit2 values are the count of the records in a database. but the diff-limit1-limit2; is not working. i am new to managed c++.kindly help me... Regards, Thilek

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      Either of these should work:

      System::Int64 limit1 = 100;
      System::Int64 limit2 = 25;
      System::Int64 diff = limit1 - limit2;
      
      System::Int64^ limit1 = gcnew System::Int64(100);
      System::Int64^ limit2 = gcnew System::Int64(25);
      System::Int64^ diff = gcnew System::Int64(\*limit1 - \*limit2);
      

      System::Int64 is a value type, so if you want to use handles to a value type (e.g. System::Int64^) then you need to create objects on the managed heap. Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      1 Reply Last reply
      0
      • T Thilek

        Hi guys, I have a question ya... minus a int64 with another int64.. below is my coding :-

        System::Int64^ limit1;
        System::Int64^ limit2;
        System::Int64^ diff;
        
           diff = limit1-limit2;
        

        the limit1 and limit2 values are the count of the records in a database. but the diff-limit1-limit2; is not working. i am new to managed c++.kindly help me... Regards, Thilek

        D Offline
        D Offline
        Dave Doknjas
        wrote on last edited by
        #3

        Don't use handles on value types.

        David Anton http://www.tangiblesoftwaresolutions.com Convert C++ to C#, VB, or Java Convert Java to C#, VB, or C++ Convert VB to C#, C++, Java, or Python Convert C# to VB, C++, Java, or Python

        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