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. difficulty coming up with the right format.

difficulty coming up with the right format.

Scheduled Pinned Locked Moved Managed C++/CLI
c++dotnetdata-structureshelpquestion
4 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.
  • U Offline
    U Offline
    User 3151224
    wrote on last edited by
    #1

    hi, i have a managed c++ project using /clr using old syntax. one of the functions in the program has the following argument list: (System::Object __gcc * _gcc yValue[]) i'm trying to pass four doubles in an array, but am having difficulty with the notation. any help? thank you

    M A 2 Replies Last reply
    0
    • U User 3151224

      hi, i have a managed c++ project using /clr using old syntax. one of the functions in the program has the following argument list: (System::Object __gcc * _gcc yValue[]) i'm trying to pass four doubles in an array, but am having difficulty with the notation. any help? thank you

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

      Member 3153721 wrote:

      i'm trying to pass four doubles in an array

      What type of array? An array of System::Object references?

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

      U 1 Reply Last reply
      0
      • M Mark Salsbery

        Member 3153721 wrote:

        i'm trying to pass four doubles in an array

        What type of array? An array of System::Object references?

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

        U Offline
        U Offline
        User 3151224
        wrote on last edited by
        #3

        it can be any one of these types: String DateTime Double Decimal Single Int32 UInt32 Int64 UInt64 it's for a winforms control. here is the link to the full method description: http://support.dundas.com/OnlineDocumentation/WinChart2005/topic1363.html[^] from the documentation, i 'should' be able to just list values in the argument, so AddY(1,2,3,4). however, managed c++ does not convert the values to an array. creating the array first and then passing the variable in the argument will not compile... it apparently does not reconginze the array value. i've come up with a work around using another set of functions in the library, but it's very difficult to get managed code to play nice with windows forms libraries to say the least.

        1 Reply Last reply
        0
        • U User 3151224

          hi, i have a managed c++ project using /clr using old syntax. one of the functions in the program has the following argument list: (System::Object __gcc * _gcc yValue[]) i'm trying to pass four doubles in an array, but am having difficulty with the notation. any help? thank you

          A Offline
          A Offline
          amatecki
          wrote on last edited by
          #4

          function declaration should look rather like the following: int AddY(System::Object __gc * yValue __gc []); or int AddY(System::Object* yValue[]); params keyword isn't supported in C++, so this function should be called with argument of type array of Object*.

          int AddY(Object* yValue[])
          {
          return yValue->Length;
          }

          Object* arr[] = new Object*[2];
          ar[0] = __box(1.1);
          ar[1] = __box(2.1);
          AddY(arr);

          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