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