Visual Studio C++ Implement Interface - windows

I know in Visual Studio, when programming in C#, if I specify that a class implements an interface, I can right click on the interface and "Implement Interface", which will auto-magically populate my class with the appropriate method signatures.
EDIT: Let me apologize for the vagueness of the original question. I'm looking for a quick easy way to get Visual Studio to do the dirty work of implementing multiple COM interfaces, i.e. generating the method signatures/stubs in the implementing class.
Thanks,
Alex

Interfaces don't exist in C++.
The level of IDE support for the language is one of C#'s perks. Visual C++ is quite a different beast indeed.

C++ does not support interfaces, so Visual Studio does not supply a "Implement Interface" feature when you're working in C++.

Related

Is there Visual Studio 10 Add-On to support auto generate C++ declaration and implementation code?

guys,
Is there a VS2010 VC++ add-on to auto generate C++ class method declaration code in header file and implementation code in cpp file when I am trying to add a new method into an existing class?
Too many add-on. Maybe there is, but I don't know which one.
Thanks.
Visual Assist X from Whole Tomato has an "Add Member" as well as "Create Implementation" and "Create Declaration" functions. It can also move implementation to source amongst other things. So far this has been the best (and only) c++ plug-in I use. Further, it's Intellisense feature is much better than Visual Studio's built in one.
Unfortunately it's not free, but well worth it.

Why are functions that belong to a class not showing in Visual C++?

I'm using Visual C++ in Visual Studio 2010 Express, and in the past I remember when you use a string object and after the dot (eg: .) all the member functions will show in list, but that's not happening.
string myString = "hello world";
myString.
After typing the dot, all functions that are part of the string class don't show. Where in Visual C++ is the setting to make them show?
The functionality you refer to is called IntelliSense in Microsoft-speak, their version of autocompletion for variable names, functions, and methods.
IntelliSense is not supported in Visual Studio 2010 for C++/CLI projects. You will only get IntelliSense for projects written in native C++ code. This is explained in more detail here on the Visual C++ Team Blog. There is also a bug filed on Microsoft Connect; the official word is this:
Thanks for your feedback. Unfortunately in this release we had to cut the intellisense support for C++/CLI due to time constraints. If you want to get some intellisense like quick info and memberlist on the native classes you can get it by choosing no /clr support in the project properties.
Thank You!
Visual C++ Team
This is unfortunate news for many of us who work with C++/CLI projects, and we aren't left with many options. A question regarding those options has been asked here: What are people replacing the missing C++/CLI Intellisense in VS 2010 with? The summary is people are either going back to VS 2008
(I believe the Express Edition of 2008 is still available for download if you look around), or purchasing third-party software such as Visual Assist X that promises to bring back IntelliSense.
It's worth mentioning, however, that Microsoft does not regard C++/CLI as a "first-class" .NET language. There's little (if any) reason to start new projects using the language. It's designed for interop purposes between native C++ and managed C# applications. If you want to write C++, you should target the native Windows API (create a new Win32 project in VS). If you want to write managed .NET code, it is highly recommended that you use C# instead (that's a different version of Express that must be downloaded separately). The syntax is very similar between C++ and C#, but you will still have to learn the .NET Framework and idioms. Both native C++ projects and managed C# projects have very much improved IntelliSense support in Visual Studio 2010, so you're guaranteed to be much happier with either of those.

Why is Intellisense "Unavailable for C++/CLI"? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
No IntelliSense for c++/cli in visual studio 2010?
As the title already states, nothing gets popped up or syntax checked. In the status bar, the following message is displayed.
Intellisense 'Unavailable for C++/CLI'
Usually I am using native C++ in Visual C++ 2010 Express.
In Visual C++ 2008, Intellisense was working correctly for C++/CLI, so I guess it should be working in this version too.
The IntelliSense parser in the C++ IDE was due for an overhaul, it had chronic problems that didn't get better with each release. Random corruption of the .ncb file, the IS database was rampant. For VS2010, it was completely rewritten, a new parser and a new way to store the results. Now an .sdf file, a SQL Compact database. The parser was written by the Edison Design Group, they are famous for being the only ones that ever wrote a C++ parser that completely implements the standard.
Sadly, they didn't have the resources to give C++/CLI the same treatment. The work is deferred, it definitely won't make it for SP1. The connect feedback report is here, only 24 votes. Cast your vote.
EDIT: this was taken care of in VS2012, it again supports IntelliSense for C++/CLI. And C++/CX, a language extension to support WinRT that has a syntax that is very similar to C++/CLI, the likely inspiration to get this work done.
From http://connect.microsoft.com/VisualStudio/feedback/details/459187/intellisense-unavailable-for-c-cli :
Hi,
As the team that invented C++/CLI, we are firm believers that it's one of the best ways to interact with managed code (whether it's to expose native objects or consume managed ones).
I want to make it clear that while we can't address this issue, we reduced support for C++/CLI only due to time and resource constraints. This is NOT an indication that we are distancing ourselves from the technology. You can still see managed classes in Class View, search for symbols, get definitions/declarations and the Winforms designer and Unit Testing functionality continue to work.
Unfortunately, it would have taken a long time to add full support for C++/CLI semantics to our new Intellisense parser and we wanted to get this into the hands of native developers in the meantime. We are sorry we couldn't do it all in one release and we eventually intend to bring this support into the Intellisense engine.
Thanks,
Boris Jabes
Visual C++ Team

Replacing/Extending Visual Studio's Generate Stub in Visual Studio 2010

When we write the name of a method that doesn't exist, Visual Studio 2010 asks us if we'd like to generate a method stub with that name. What I'd like to know if is it possible to replace that same code stub generating command with one made by myself. I never did any kind of extensibility programming for Visual Studio so I have a couple of questions:
How hard is it? Is it something I can learn in a couple of nights, or is it something that'll make me "lose" a lot of time?
It seems to me that there isn't a lot of support for that kind of programming, as generally people are not that interested in developing solutions that extend the Visual Studio IDE. I searched on SO and it doesn't appear to have many threads about extending Visual Studio.
I don't know how the generate method stub thing works in Visual Studio, but I just wanted to turn it into something a bit more flexible and useful. Has anyone dealt with these kind of things before, that can give me a pointer to where to start? I know of MS VSX site but that has a lot of resources and can be overwhelming for someone new to the subject as I am.
What technology will I need to use? T4? Maybe I'll need to know a lot about the code, like Visual Studio does, so I can know other method's type arguments, names, etc. Is that what T4 is for?
Thanks
I searched the web a bit and I don't see anything about customizing the "Suggested Fix." Your thought in #2 is probably spot-on.
You can modify the VS editor by reading through http://msdn.microsoft.com/en-us/library/dd885242.aspx.

How to modify JavaScript Intellisense by using Visual Studio Integration Package?

I need to modify some logic of Javascript Intellisense on Visual Studio 2008 SP1 like some build-in function such as ScriptEngine, ScriptEngineBuildVersion and etc. Moreover, I need to dynamically generate function depend on opened docuement.
In Visual Studio, language services are provided via VSPackages. Most built-in language services in Visual Studio 2008 do not really offer any kind of extensibility or customization that would enable what you're trying to achieve.
There are a couple of options you could consider though:
Write your own Javascript language service. Obviously, this would be non-trivial, but it would allow you to get the precise behavior you're after. Language services are responsible for parsing the file to provide colorization, quick info, Intellisense, auto-completion, and other features to the core text editor. The simplest example of a language service is a sample in the Visual Studio 2008 SDK 1.1 called the RegExLangService. There is also a detailed walkthrough for the sample.
You could attempt implementing either an Add-in or a VSPackage which would insert/manipulate text in the editor based on the contents of the open document. Your question doesn't really say exactly what kind of behavior you need (other than dynamically generating a function). This would certainly be possible with the Visual Studio SDK and much less work than writing your own Javascript language service.
Good Luck!

Resources