I make Visual Studio Extension for C++. I can get source code from file using DTE.ActiveDocument, but it can contain elements like macros that will be replaced after preprocess