I'm trying to run the following code(to discover all variable names in a vc++ project):
But it fails to work as the conversion does not succeed and returns null, and I'm running this code from a c++ project.
What's the problem here?
VCCodeModel model = _applicationObject.Solution.Item(1).CodeModel as VCCodeModel;
foreach (VCCodeVariable elem in model.Variables)
{
string s = elem.DisplayName;
// ...
}But it fails to work as the conversion does not succeed and returns null, and I'm running this code from a c++ project.
What's the problem here?