Click here to Skip to main content
15,885,914 members

Comments by OlegKrivtsov (Top 6 by date)

OlegKrivtsov 22-Jul-11 23:45pm View    
To get a selected item in the right-click handler, I would call HitTest() method of the list control. For example, like this:

// Get cursor pos
CRect ptCursor;
GetCursorPos(&ptCursor);
// Hit test
LVHITTESTINFO hti;
hti.pt = ptCursor;
m_list.HitTest(&hti);

then I would determine the item from hti.
OlegKrivtsov 16-Jul-11 2:26am View    
I voted 2, because you didn't answer my question. If this is not a waste of time, than how to do this correctly? If you have ever worked with WTL, you should know that all window messages are handled inside of CCalculatorDlg class, not in another class. To handle messages in CCalculatorController class I should do a lot of work to redirect messages to that class, and I must know what's the advantage of doing this? I don't see for now..
OlegKrivtsov 15-Jul-11 6:07am View    
Thanks for your explanation, but it still unclear for me.

"The events of the window should be implemented in Controller"
Should I write another class, say CCalculatorController? But if I write it, this is waste of time, because it is easier to handle events in CCalculatorDlg class with built-in message map.
OlegKrivtsov 30-Jun-11 21:20pm View    
Btw, will my commercial videos be considered as a source code of my site?
OlegKrivtsov 21-Jun-11 21:19pm View    
Packing options are defined by #pragma pack

http://msdn.microsoft.com/en-us/library/2e70t5y1(v=vs.80).aspx

For example, try to add this line before your class:

#pragma pack(1)

.. and the following line after the class declaration:

#pragma pack()