You first need to check that you are actually retrieving some text from your control. Is this code inside the dialog that holds the combobox? You also need to set the text length in your TCITEM before sending the TCM_INSERTITEM message.
I assume it's part of the spec, based on the following error messages:
1>c:\users\richard\documents\visual studio 2010\projects.c++\aconsole\aconsole\aconsole.cpp(98): error C2668: 'B::Function' : ambiguous call to overloaded function
1> c:\users\richard\documents\visual studio 2010\projects.c++\aconsole\aconsole\aconsole.cpp(91): could be 'void B::Function(A::Things)'
1> c:\users\richard\documents\visual studio 2010\projects.c++\aconsole\aconsole\aconsole.cpp(83): or 'void A::Function(A::Things)' [found using argument-dependent lookup]
1> while trying to match the argument list '(A::Things)'
It's Argument Dependent Lookup (ADL) also known as Koenig lookup. It's invaluable when you're trying to define operations on a type in a namespace using functions in that namespace. Say you have:
friend A operator+( const A &, const A& );
// Somewhere else...
A a, b;
auto c = a + b;
if the compiler didn't know to look for the operator in the namespace A was declared in you wouldn't be able to use operator functions in namespaces that easily. It would be a particular headache for <, << and >> which are required by chunks of the standard library.
Hi, I have two processes running on a system. One process is of socket based connection type and another process is of a serial based connection type. Here the requirement is the information provided by one process should be sent across to another process based on which it will perform some action.
Could anyone please let me know a suitable solution for this in vc++ and if any example project for the same. Thanks in advance.
I've had to do this many times, and have found the easiest way is to use (global) named pipes. The process that does the word opens the pipe server, and just waits for a message to come through. Any processes that need an action to be preformed then open a client pipe, and sends all the data through. This system even allows for duplex messaging, so the server can send a response and/or the results of the processing back to the caller if required.
The Microsoft Devcenter explains it all pretty well, with examples, here[^].
When it compiles in debug builds, the compiler gets stuck during optimisation.
See also the MSDN Fatal Error C1001[^]. It suggests to disable optimisation for the function or rewrite the code.
With older VS versions I had such errors a few times and solved them always by re-ordering some code lines. As you already noticed, reducing (simplifying) the code may not help. Instead it might help to add code lines.
case IDOK://checks if buffer is empty or not when the user clicks OK on the dialog
l also tried GetWindowText(hwnd,userName,sizeof(userName)/sizeof(userName))
still it doesn't work. Please can someone me guide me on getting user input and checking if the buffer is empty or not.
The selected menu item has a dark gray background, and I don't like it. It can't be replaced by the theme.
I want to restore its style to Windows 8/8.1 style, like this(Windows 10 earlier insider builds):
I have programmed a COM dll and attach it to the explorer, it's able to retrieve the handle of the context menu, but I discovered that none of those menu items have the "MF_OWNERDRAWN" flag, they just have "MF_STRING" flag.
So things start to getting wired, perhaps they are not normal owner drawn menus?
My question is how does the explorer render its context menu? And are there anyway to customize its style? eg using hook?