Click here to Skip to main content
15,893,487 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionabout HKEY_CLASSES_ROOT TypeLib Pin
George_George2-Sep-07 23:27
George_George2-Sep-07 23:27 
QuestionStack overflow while reading bamp image Pin
Maynka2-Sep-07 23:26
Maynka2-Sep-07 23:26 
AnswerRe: Stack overflow while reading bamp image Pin
chandu0042-Sep-07 23:48
chandu0042-Sep-07 23:48 
AnswerRe: Stack overflow while reading bamp image Pin
Russell'2-Sep-07 23:55
Russell'2-Sep-07 23:55 
AnswerRe: Stack overflow while reading bamp image Pin
Mark Salsbery3-Sep-07 9:05
Mark Salsbery3-Sep-07 9:05 
GeneralRe: Stack overflow while reading bamp image Pin
Maynka3-Sep-07 18:45
Maynka3-Sep-07 18:45 
GeneralRe: Stack overflow while reading bamp image Pin
Mark Salsbery3-Sep-07 20:31
Mark Salsbery3-Sep-07 20:31 
QuestionPicture Control / Client Rectangle Pin
TheShihan2-Sep-07 23:22
TheShihan2-Sep-07 23:22 
Hi,

I'm currently trying to implement a pan function for panning images which are displayed in a picture control area (drawing with GDI+).

I've managed to change the mouse cursor, it should be a hand when the cursor is over the picture control and an arrow everywhere else. A part of that seems to work. I check if the mouse position is inside the area of the picture control but somehow the area "thinks" it's startpoint (upper left) is located @ x: 0 y: 0; in fact it is placed somewhere in the middle of the dialog box.

Here is the snippet:
/**************************************************************************************/
void CTrackAndTraceDlg::OnMouseMove(UINT nFlags, CPoint point)
/**************************************************************************************/
{
	HCURSOR hcur = NULL;

	CRect rc;
	m_pictureControl.GetClientRect(&rc);
	rc.NormalizeRect();

	//Get current mouse position
	POINT MousePosition = point;

	BOOL isOnPictureControl = PtInRect(&rc, MousePosition);

	if(isOnPictureControl && m_bPicLoaded && hcur == NULL)
	{
			// mouse is over the picture control AND a picture is loaded
			hcur = LoadCursor(AfxGetApp()->m_hInstance,(LPCTSTR)IDC_CUR_PAN);	
			SetCursor(hcur);
	}
	else
	{
			SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
			hcur = NULL;
	}

	CDialog::OnMouseMove(nFlags, point);
}


As you see I get the rectangle from the m_pictureControl (which is a var for the Picture Control on the dialog). But why it gives back the wrong x,y -> the rc.Width and rc.Height are correct.

Any ideas?

Thx, Shi
GeneralRe: Picture Control / Client Rectangle Pin
chandu0042-Sep-07 23:46
chandu0042-Sep-07 23:46 
GeneralRe: Picture Control / Client Rectangle Pin
TheShihan3-Sep-07 0:02
TheShihan3-Sep-07 0:02 
GeneralRe: Picture Control / Client Rectangle Pin
chandu0043-Sep-07 0:13
chandu0043-Sep-07 0:13 
Questionmsi.lib Pin
himanshu p taunk2-Sep-07 22:58
himanshu p taunk2-Sep-07 22:58 
AnswerRe: msi.lib Pin
Hamid_RT3-Sep-07 0:07
Hamid_RT3-Sep-07 0:07 
QuestionCan anyone tell me whats wrong with this mime format Pin
monsieur_jj2-Sep-07 21:17
monsieur_jj2-Sep-07 21:17 
QuestionNeed help about SIP protocol on PDA Pin
goooff2-Sep-07 21:09
goooff2-Sep-07 21:09 
QuestionIncluding files present in subfolders in VC++ Pin
vipin_nvk2-Sep-07 20:48
vipin_nvk2-Sep-07 20:48 
AnswerRe: Including files present in subfolders in VC++ Pin
chandu0042-Sep-07 21:38
chandu0042-Sep-07 21:38 
AnswerRe: Including files present in subfolders in VC++ Pin
jhwurmbach3-Sep-07 2:45
jhwurmbach3-Sep-07 2:45 
Question/Gz;/Gd;/Gr Pin
nitin32-Sep-07 20:40
nitin32-Sep-07 20:40 
QuestionGantt Chart Pin
c072-Sep-07 20:21
c072-Sep-07 20:21 
AnswerRe: Gantt Chart Pin
chandu0042-Sep-07 21:35
chandu0042-Sep-07 21:35 
GeneralRe: Gantt Chart Pin
BadKarma2-Sep-07 23:48
BadKarma2-Sep-07 23:48 
AnswerRe: Gantt Chart Pin
Hamid_RT2-Sep-07 21:37
Hamid_RT2-Sep-07 21:37 
AnswerRe: Gantt Chart Pin
c072-Sep-07 22:36
c072-Sep-07 22:36 
QuestionI Need to make the CListCtrl non sortable at run time Pin
Javed Akhtar Ansari2-Sep-07 20:06
Javed Akhtar Ansari2-Sep-07 20:06 

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.