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. create a property with class type (class name is : system::io::ports:serialport)

create a property with class type (class name is : system::io::ports:serialport)

Scheduled Pinned Locked Moved Managed C++/CLI
question
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.
  • I Offline
    I Offline
    iman_kh
    wrote on last edited by
    #1

    hi i want to create a property on my object and type of it is system::io::ports::serialport , but i can't ! how can i create this property ?

    M N 2 Replies Last reply
    0
    • I iman_kh

      hi i want to create a property on my object and type of it is system::io::ports::serialport , but i can't ! how can i create this property ?

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

      iman_kh wrote:

      i want to create a property on my object

      What is a property on an object?

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

      1 Reply Last reply
      0
      • I iman_kh

        hi i want to create a property on my object and type of it is system::io::ports::serialport , but i can't ! how can i create this property ?

        N Offline
        N Offline
        N a v a n e e t h
        wrote on last edited by
        #3

        iman_kh wrote:

        i want to create a property on my object

        :confused: do you mean property for your class? If yes see the below code

        property System::IO::Ports::SerialPort^ SampleProperty
        {
        System::IO::Ports::SerialPort^ get(){
        // your code goes here
        }

          void set(System::IO::Ports::SerialPort^ port){
           // your code
          }
        

        };

        C++/CLI also has a simple way to declare the properties. You just need to write

        property System::IO::Ports::SerialPort^ SampleProperty;

        . Compiler generates the backing fields for you.

        Navaneeth How to use google | Ask smart questions

        I 1 Reply Last reply
        0
        • N N a v a n e e t h

          iman_kh wrote:

          i want to create a property on my object

          :confused: do you mean property for your class? If yes see the below code

          property System::IO::Ports::SerialPort^ SampleProperty
          {
          System::IO::Ports::SerialPort^ get(){
          // your code goes here
          }

            void set(System::IO::Ports::SerialPort^ port){
             // your code
            }
          

          };

          C++/CLI also has a simple way to declare the properties. You just need to write

          property System::IO::Ports::SerialPort^ SampleProperty;

          . Compiler generates the backing fields for you.

          Navaneeth How to use google | Ask smart questions

          I Offline
          I Offline
          iman_kh
          wrote on last edited by
          #4

          hi, yes so thanks for your help,this was helpful:rose:

          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