Pasting formed an invalid processing token '.'

delete "##".

#define DELEGATE_FUNC(FuncName, kind, paramPtr)     \
if (kind == 1) {                                    \
    return PolicyObject1.FuncName(paramPtr);        \
}                                                   \
else {                                              \
    return PolicyObject2.FuncName(paramPtr);        \
}                                                   \
return 0;                                           \

When the compiler reads your C++ file, one of the first steps is dividing it into tokens like identifier, string literal, number, punctuation, etc. The C preprocessor works on these tokens, not on text. The ## operator glues tokens together. So, for example, if you have

#define triple(foo) foo##3

Then triple(x) will get you the identifier x3, triple(12) will get you the integer 123, and triple(.) will get you the float .3.

However, what you have is .##FuncName, where FuncName is ProcessPreCreate. This creates the single token .ProcessPreCreate, which is not a valid C++ token. If you had typed PolicyObject1.ProcessPreCreate directly instead of through a macro, it would be tokenized into three tokens: PolicyObject1, ., and ProcessPreCreate. This is what your macro needs to produce in order to give valid C++ output.

To do that, simply get rid of the ##. It is unnecessary to glue the . to the FuncName, because they are separate tokens. To check this, you can put a space between a . and a member name; it will still compile just fine. Since they are separate tokens, they should not and cannot be glued together.