Click here to Skip to main content
15,888,461 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionfunction doesn't reply Pin
hasani200715-May-10 9:51
hasani200715-May-10 9:51 
AnswerRe: function doesn't reply PinPopular
Code-o-mat15-May-10 10:14
Code-o-mat15-May-10 10:14 
AnswerRe: function doesn't reply Pin
Dr.Walt Fair, PE15-May-10 10:28
professionalDr.Walt Fair, PE15-May-10 10:28 
AnswerRe: function doesn't reply Pin
Software_Developer15-May-10 10:37
Software_Developer15-May-10 10:37 
GeneralRe: function doesn't reply Pin
Member 392263917-May-10 2:36
Member 392263917-May-10 2:36 
GeneralRe: Thanks Pin
Software_Developer17-May-10 5:13
Software_Developer17-May-10 5:13 
AnswerRe: function doesn't reply Pin
loyal ginger15-May-10 10:43
loyal ginger15-May-10 10:43 
QuestionButton behavior - single button multiple behaviour Pin
Software_Developer15-May-10 7:57
Software_Developer15-May-10 7:57 
At 5:35 on the 13th of May 2010, AbhiHcl wrote:
>>>
>>> Hi,
>>>
>>> Can I use single button for more than one behaviour.
>>> For example one button is devide into 2 parts,
>>> If I click on first part minus operation should be performed
>>> and click on second part + opeartion should be performed.
>>>
>>>



Yes you can use one single button for more than one behaviour.

Here is how.

If you have the coordinates of a point in device coordinates
and want to find the corresponding position in logcal view -
use CDC::DPtoLP to convert the device coordinates to logcal coordinates.
Call on OnPrepareDC first to set the mapping mode and factor.


For example: Here is a WM_LEFTBUTTONDOWN handler that performs a simple hit test
to determine whether the click point lies in the upper or lower half of the logcal view.

CPoint objects passed to OnLButtonDown and other mouse message handlers
always contain device coordinates so conversion is essential.

void CMyView::OnLButtonDown(UINT nFlags, CPoint Point)
{
  CPoint pos=Point;
  CClientDC dc (this);
  OnPrepareDC(&dc);     //
  dc.DPtoLP(&pos);
  CSize size=GetTotalSize();
  if(::abs( pos.y ) < (size.cy/2) )
  {
    //Upper half was clicked
  }
   else
  {
    //lower half was clicked
  }
 

}


...
QuestionWritePrivateProfileString to write Ini file problem Pin
Shivanand Gupta15-May-10 6:52
Shivanand Gupta15-May-10 6:52 
AnswerRe: WritePrivateProfileString to write Ini file problem Pin
norish15-May-10 8:32
norish15-May-10 8:32 
GeneralRe: WritePrivateProfileString to write Ini file problem Pin
Shivanand Gupta16-May-10 20:57
Shivanand Gupta16-May-10 20:57 
Questionhow hook the registry Pin
Natural_Demon15-May-10 4:27
Natural_Demon15-May-10 4:27 
AnswerRe: how hook the registry Pin
Software_Developer15-May-10 5:49
Software_Developer15-May-10 5:49 
AnswerRe: how hook the registry Pin
Code-o-mat15-May-10 5:51
Code-o-mat15-May-10 5:51 
GeneralRe: how hook the registry Pin
Natural_Demon15-May-10 9:51
Natural_Demon15-May-10 9:51 
GeneralRe: how hook the registry Pin
Code-o-mat15-May-10 10:00
Code-o-mat15-May-10 10:00 
GeneralRe: how hook the registry Pin
Natural_Demon15-May-10 14:54
Natural_Demon15-May-10 14:54 
GeneralRe: how hook the registry Pin
Natural_Demon15-May-10 15:22
Natural_Demon15-May-10 15:22 
GeneralRe: how hook the registry Pin
Code-o-mat16-May-10 0:17
Code-o-mat16-May-10 0:17 
GeneralRe: how hook the registry Pin
Natural_Demon16-May-10 6:57
Natural_Demon16-May-10 6:57 
QuestionVisual Studio unmanaged C++ TCP/IP client-server examples Pin
Stevo Z14-May-10 23:05
Stevo Z14-May-10 23:05 
AnswerRe: Visual Studio unmanaged C++ TCP/IP client-server examples Pin
Richard MacCutchan15-May-10 2:36
mveRichard MacCutchan15-May-10 2:36 
GeneralRe: Visual Studio unmanaged C++ TCP/IP client-server examples Pin
Hristo-Bojilov15-May-10 2:51
Hristo-Bojilov15-May-10 2:51 
GeneralRe: Visual Studio unmanaged C++ TCP/IP client-server examples Pin
Richard MacCutchan15-May-10 4:23
mveRichard MacCutchan15-May-10 4:23 
GeneralRe: Visual Studio unmanaged C++ TCP/IP client-server examples Pin
Stevo Z15-May-10 4:41
Stevo Z15-May-10 4:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.