according to MSDN:
The selection, if any, is always shown, even if the control does not have the focus.
This is true but it isn't highlighted in blue. Nomatter where I place the SetFocus call, nothing is happening. I have tried before setting item state, after setting state, beginning and end of WM_INITDIALOG, WM_CREATE, WM_SETFOCUS, WM_IMNOTGIVINGYOUFOCUSHAHAHA. Infact the only place it is working is within WM_PAINT, but this is just wrong.
This control is on a dialog along with sevral other controls. The only other thing I can think of is to change the tab order, but still, SetFocus should be unrelated to the tabs.
When you right click a CD/DVD-ROM, windows will show a menu, and one of its menuitem is just the "Eject"! I want to control the flow of eject action,when user click the menuitem, it will go into my codes.
I use the ModifyMenu function to modify the "eject" menuitem, but how could i know if the current menuitem is "eject",just as what i want? If use the MF_BYPOSITION flag, it is impossible to get the position of the "eject" menuitem. If use MF_COMMAND, after a long trace to code, i find the ID of "eject" menuitem can be case 31014://normal
case 30757://folder view
case 47://tree view while using folder mode
case 31078://short cut
case 102:// quick launch
case 38://tree view in the application of winrar
case 39://toolbar on taskbar
I have to use a switch statement to handle the condition.
I don't konw if the "eject" ID have other value, and if i find it, i have to modify my code, it boring me so much. Could someone help me to fix this trouble? All codes are place at function
HRESULT CXXXXXX::QueryContextMenu ( HMENU hmenu, UINT uMenuIndex,
UINT uidFirstCmd, UINT uidLastCmd, UINT uFlags ).
I had an simple object by using ATL Object wizard and a generic class CTCPSocket.
The com object name is CTest and interface is ITest. This class had a interface Add and a connection point Fire_notify.
And CSocket had two methods add_in and notify.
The code as following:
//create a socket and listening
//created a tcp connectiong?
//when created a socket accept,pass the event to CTest:OnNotify()
when the client call the CTest->Add method, CTCPSocket will create a socket and listening, but the problem is: when there is a tcp connection event,how to pass the event to CTest:OnNotify() from CTCPSocket:notify()?
Assuming that you by char really mean std::string (because you're a conscious developer that avoids bald arrays and pointers if possible, right? ), then do like this:
std::string ToString(unsigned longvalue) // Put this function in your local vault.
char buffer; // '33' comes from the _ultoa documentation.return std::string(_ultoa(value, buffer, 10));
You're still assuming too much about his problem. Is he actually writing C++, or maintaining (or even writing) an ANSI C program? He hasn't told us. Your solution, while excellent for C++, is not very useful for a C program.
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late"John Nichol "Point Of Impact"
I'm porting some VC6 code to Visual Studio 2005. When I compile, I'm getting the following errors:
combase.h(253): error C2373: 'InterlockedExchange' : redefinition; different type modifiers
combase.h(253): error C2491: 'InterlockedExchange' : definition of dllimport function not allowed
combase.h(253): error C3861: 'InterlockedExchange': identifier not found, even with argument-dependent lookup
C++ being a secondary language for me, I'm having trouble figuring this out. Previously this code compiled fine under VC6, yet I get these compiler errors under VS7 and VS8.
Combase.h is a DirectShow base definition header, it appears...