C++ equivalent?

D

DanB

Hi,
In c# where I would access a named property of a chart series like:
series["DrawingStyle"]= columnStyle;
But I can't figure out how to do the equivalent in c++.


Where a 'normal' property would be set like this in c++:
series->MarkerSize= markerSize;
c#
series.MarkerSize= markerSize;

Thanks, Dan.
 
A

Arne Vajhøj

In c# where I would access a named property of a chart series like:
series["DrawingStyle"]= columnStyle;
But I can't figure out how to do the equivalent in c++.


Where a 'normal' property would be set like this in c++:
series->MarkerSize= markerSize;
c#
series.MarkerSize= markerSize;

C++ CLI: property keyword and an argument of type String^ (or
just use a Dictionary<Something^,String^>).

Standard C++: operator overload of [] and an argument of type
string (or just use a map<something,string>).

Arne
 
D

DanB

Arne said:
In c# where I would access a named property of a chart series like:
series["DrawingStyle"]= columnStyle;
But I can't figure out how to do the equivalent in c++.


Where a 'normal' property would be set like this in c++:
series->MarkerSize= markerSize;
c#
series.MarkerSize= markerSize;

C++ CLI: property keyword and an argument of type String^ (or
just use a Dictionary<Something^,String^>).

Standard C++: operator overload of [] and an argument of type
string (or just use a map<something,string>).

Hi Arne,
Thanks. But I'm not looking to create this. What I'm trying to do is
access this property in:

System::Windows::Forms::DataVisualization::Charting::Series

This is a named property rather than a plain old member, if those are
the right words...

Native is my language, I don't know the syntax/member?/whatever to
access this series member in managed c++, I have only seen the c#
example. gcroot has no facility to use a bracketed access on the object.
Nor do I know how I would do it with the handle. I'm not having a lot of
luck with google searches as I don't really know what key words to use
that would narrow this down.

Best, Dan.
 
A

Arne Vajhøj

Arne said:
In c# where I would access a named property of a chart series like:
series["DrawingStyle"]= columnStyle;
But I can't figure out how to do the equivalent in c++.


Where a 'normal' property would be set like this in c++:
series->MarkerSize= markerSize;
c#
series.MarkerSize= markerSize;

C++ CLI: property keyword and an argument of type String^ (or
just use a Dictionary<Something^,String^>).

Standard C++: operator overload of [] and an argument of type
string (or just use a map<something,string>).
Thanks. But I'm not looking to create this. What I'm trying to do is
access this property in:

System::Windows::Forms::DataVisualization::Charting::Series

This is a named property rather than a plain old member, if those are
the right words...

Native is my language, I don't know the syntax/member?/whatever to
access this series member in managed c++, I have only seen the c#
example. gcroot has no facility to use a bracketed access on the object.
Nor do I know how I would do it with the handle. I'm not having a lot of
luck with google searches as I don't really know what key words to use
that would narrow this down.

something["foobar"] or something[L"foobar"] should work in C++ CLI if
something["foobar"] work in C#.

Arne
 
D

DanB

Arne said:
Arne said:
On 23-04-2010 17:41, DanB wrote:
In c# where I would access a named property of a chart series like:
series["DrawingStyle"]= columnStyle;
But I can't figure out how to do the equivalent in c++.


Where a 'normal' property would be set like this in c++:
series->MarkerSize= markerSize;
c#
series.MarkerSize= markerSize;

C++ CLI: property keyword and an argument of type String^ (or
just use a Dictionary<Something^,String^>).

Standard C++: operator overload of [] and an argument of type
string (or just use a map<something,string>).
Thanks. But I'm not looking to create this. What I'm trying to do is
access this property in:

System::Windows::Forms::DataVisualization::Charting::Series

This is a named property rather than a plain old member, if those are
the right words...

Native is my language, I don't know the syntax/member?/whatever to
access this series member in managed c++, I have only seen the c#
example. gcroot has no facility to use a bracketed access on the object.
Nor do I know how I would do it with the handle. I'm not having a lot of
luck with google searches as I don't really know what key words to use
that would narrow this down.

something["foobar"] or something[L"foobar"] should work in C++ CLI if
something["foobar"] work in C#.

Hi Arne,
No, not if 'something is handle to a managed object.

The error is:
3>.\Chart.cpp(58) : error C2676: binary '[' : 'gcroot<T>' does not
define this operator or a conversion to a type acceptable to the
predefined operator
~~

But I just stumbled on a work around. If I pass my chart object and
access the series after it has been added to the chart, I can:

chart->chart->Series[ index ]["DrawingStyle"]= columnStyle;

Best, Dan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top