Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

[C++] - converting 1 line to a macro

$
0
0

i wanted convert these comment to a macro:

//__declspec(property(get = GetFunctionName, put = SetFunctionName)) int PropertyName;
#define Property(x,y) (j) __declspec(property((get = x),(put = y))) (j)

GetFunctionName() and SetFunctionName() are functions for change and get values.

heres how i'm using it:

Property(GetValueA, SetValueA) int ValueA;

but i'm getting problems for use the macro:(

error message:

"IntelliSense: this declaration has no storage class or type specifier"

can anyone advice me?

heres the correct one with original:

__declspec(property(get = GetValueA, put = SetValueA)) int ValueA;


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>