views:

35

answers:

1

When I call cin or getline with cin in my Visual Studio 2010 C++ app, I can enter something in the console (as it should be), but the right-click context menu is "blocked". It doesn't appear - this means I and my clients are not able to use copy and paste.

  • How to enable the context menu in the console with cin?
A: 

This is an end user configuration for console windows. Click on the title bar icon, select properties, on the options tab, uncheck QuickEdit mode.

However copy & past is in fact simpler in QuickEdit mode: Right click performs an immediate paste operation if there is text in the clipboard. Text is copied by highlighting by dragging over the text to be copied, and pressing "Enter" to place the text in the clipboard. Switching off QuickEdit us useful for console programs that consume mouse events directly.

I am not sure that there is a programmatic method of switching the edit mode, but since it is by design an end user preference, it would probably be bad form to impose your own preference.

Clifford
This is not my problem. A) QuickEdit mode was and is already turned off and B) I don't have the problems with other applications making use of the console
sub
Clifford
... I just noticed that you used VC++2010. I find it hard to believe that it would make a difference, but I tested it with VC++ 2008.
Clifford