Original Post
I'm using a macro defined as such: Edit: I've got backslashes to escape the end of each line there, but it seems to mangle the formatting Then I use it like so: I cannot figure this one out, can someone show me whats wrong? Cheers
#define PROPERTY_EDIT(theVar, theLabel, theDesc) if (bInit)
{
CPropItem item;
item.Type = 0;
item.Label = theLabel ;
item.Description = theDesc ;
Items.push_back(item);
}
else
{
if (SLabel == theLabel )
{
eData-> theVar = szValue;
}
}
PROPERTY_EDIT(m_Text, "bob", "Description"); However I get the following errors pointing to that line: error C2065: 'm_Text' : undeclared identifier
error C2501: 'PROPERTY_EDIT' : missing storage-class or type specifiers
error C2078: too many initializers
error C2440: 'initializing' : cannot convert from 'char [12]' to 'int' Weirdest is why the hell is it converting the "Description" string to an integer?? If I paste the code of what I'd expect it to expand to, this compiles fine without any problems: if (bInit)
{
CPropItem item;
item.Type = 0;
item.Label = "bob";
item.Description = "Descriptive text";
Items.push_back(item);
}
else
{
if (SLabel == "bob")
{
eData->m_Text = szValue;
}
}