Handling expansions

Hi again,

Please, I need some help with the preprocessor directives. I will describe my situation.
I have a directive in my file:

#define MY_DIRECTIVE( param ) { … }

Then, I invoke the directive within a method:

void MyClass::Method()

MY_DIRECTIVE (param1);


My goal is to perform a change in the param passed, for instance, changing param1 by param2. I can make the modification with replaceText without any problem; however, it produces a “Stack dump” when I get the content with:

const RewriteBuffer *RewriteBuf = Rewrite.getRewriteBufferFor(file_id);

What is the problem? How can I handle this? I’m really lost with the expansions…