C++ programming in VC

Can I use C++ for VC programming development instead of C# , Is there any example how to implement the new feature or functioning tab to VC product with C++?C++ API

It is a .NET API so in theory you could use any of the CLI languages for your plugins.
https://en.wikipedia.org/wiki/List_of_CLI_languages

I know that at least VB.NET has been used successfully. C++/CLI also exists, but I really wouldn’t recommend it over C# unless you have some large C++ libraries you have to use in your plugin.

I haven’t seen any examples made with other than C#, but generally the .NET concepts are the same, just syntax differs and that you can learn from general online resources.

I’m thinking about importing a big library of motion planning that is written in C++. May I ask what’s not recommended about writing the plugin in C++ ? Is there some problems or is it just that there’s not many examples to follow for coding in C++ ?

I have not tried making a VC plugin with C++/CLI nor have heard anybody try it either.

Generally C++/CLI is only intended and used for writing a wrapper layer between native C++ and managed .NET code, which is usually C#. This approach is probably enough for your needs as well.

If you tried to do everything with C++/CLI, I would expect issues in implementing UI and anything else that depends on special tooling. In any case, the C++ syntax is quite cumbersome for most tasks compared to C#.

I would recommend identifying some minimal API you’ll want to call from your UI C# code and then implement that with C++/CLI code which in turn uses the native C++ library. Such wrappers don’t need to be just trivial redirection of calls to the native code, which is the strength of the C++/CLI language.

1 Like