Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

unable to cast from CodeModel to Microsoft.VisualStudio.VCCodeModel

$
0
0
I'm trying to run the following code(to discover all variable names in a vc++ project):

                    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?


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>