@blingg: TC_ITEM is same as TCITEM but according to MSDN, TCITEM supercedes TC_ITEM.
However, l have done the corrections, still it doesn't work. l also used SendMessage, still yet no avail. l don't know what's wrong.
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.