-
April 4th, 2013, 12:03 PM
#1
how to create property which I can pass parameters?
Hello,
Is it possible to create property which I can pass parameters? would you please give me an example or solution? here is what I would like to do:
__property double a = {read=getA("a"), write=setA("a")};
__property double b= {read=getB("c"), write=setB("c")};
double getA(char *a);
void setA(double value, char *a);
double getB(char *a);
void setB(double value, char*a);
Thank you!
-
April 4th, 2013, 04:19 PM
#2
Re: how to create property which I can pass parameters?
I already posted in your other thread over there in the VC++ section, where I stated that IMO something taking parameters is not a property, but rather a member function (with the exception of the .NET default property, AKA indexer).
However, while researching a suitible link to post for you, it turned out that apparently .NET and C++/CLI do allow for non-default indexed properties. IIRC I once tried that in one of my programs and didn't get it to work (for whatever reason), and then gave up further pursuing that idea.
See these links:
How to: Use Indexed Properties
How to: Use Multidimensional Properties
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|