I'm working in the MS cluster resource API and trying to initialize a property table. Here is the example code (all C++) right from MS docs:
// Private property data.
// Only MyTypeAlpha defines private properties.
#define PROP_NAME__MAXUSERS L"MaxUsers"
#define PROP_MIN__MAXUSERS (-1)
#define PROP_MAX__MAXUSERS (256)
#define PROP_DEFAULT__MAXUSERS (8)
typedef struct _PARAM_BLOCK_ALPHA
{
LONG nMaxUsers;
}
PARAM_BLOCK_ALPHA, * PPARAM_BLOCK_ALPHA;
RESUTIL_PROPERTY_ITEM PROP_TABLE_ALPHA[] =
{
{
PROP_NAME__MAXUSERS,
NULL,
CLUSPROP_FORMAT_LONG,
(DWORD) PROP_DEFAULT__MAXUSERS,
(DWORD) PROP_MIN__MAXUSERS,
(DWORD) PROP_MAX__MAXUSERS,
RESUTIL_PROPITEM_REQUIRED,
FIELD_OFFSET( PARAM_BLOCK_ALPHA,
nMaxUsers )
},
{ 0 }
};
When I paste this code into my project I get the compiler error:
E0144 a value of type "const wchar_t *" cannot be used to initialize an entity of type "LPWSTR"
It doesn't like the PROP_NAME__MAXUSERS
being passed in to the name data member which is a LPWSTR
type.
I see this all over M/S examples, so I must be missing something fundamental.
Any ideas?