Click here to Skip to main content
15,903,362 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionON_MESSAGE vs linker Pin
greghint5-Aug-08 14:28
greghint5-Aug-08 14:28 
GeneralRe: ON_MESSAGE vs linker [modified] Pin
fantasy12155-Aug-08 15:59
fantasy12155-Aug-08 15:59 
AnswerRe: ON_MESSAGE vs linker Pin
Mark Salsbery6-Aug-08 5:36
Mark Salsbery6-Aug-08 5:36 
GeneralRe: ON_MESSAGE vs linker Pin
greghint6-Aug-08 6:10
greghint6-Aug-08 6:10 
QuestionHow do I alter the mfc image icon - (on the top left corner of all programs) Pin
simon alec smith5-Aug-08 11:28
simon alec smith5-Aug-08 11:28 
AnswerRe: How do I alter the mfc image icon - (on the top left corner of all programs) Pin
Mark Salsbery5-Aug-08 11:55
Mark Salsbery5-Aug-08 11:55 
AnswerRe: How do I alter the mfc image icon - (on the top left corner of all programs) Pin
hoxsiew5-Aug-08 14:15
hoxsiew5-Aug-08 14:15 
QuestionQuestion about using the CSliderCtrl to control the Ruler... Pin
oppstp5-Aug-08 9:32
oppstp5-Aug-08 9:32 
Hello,
I am writing a program about using the CSliderCtrl (vc provided) to control the ruler.
There is also a scroll bar for the ruler. (Sometimes the ruler length may be too long)
All I want is when I dragging the slider, the interval between two meter unit of the ruler will be changed automatically.
The ruler I used is this : http://www.codeproject.com/KB/miscctrl/uhrulerctrl.aspx

Now the interval between two meter unit would be changed when I dragged the slider.
But there's another problem. The problem is the ruler will jump to the start meter of the ruler automatically. (The scrollbar is activated)
I want the ruler can keep the original position when I dragged the slider.
(The ruler can keep the original position by a scrollbar in the demo project)

I tried some methods but the ruler always jump to the start meter...
Can someone help me to solve this question ?

Below is my part code :
void CtrlRulerDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)<br />
{ <br />
	// TODO: Add your message handler code here and/or call default<br />
	SCROLLINFO  si;<br />
	m_ScrollBar.GetScrollInfo( &si , SIF_ALL );<br />
	INT iScrollPos = si.nPos;<br />
	int i = 0;<br />
	<br />
	switch( nSBCode ) {<br />
		case TB_PAGEDOWN:<br />
			si.nPos += 5;<br />
			i = m_Slider.GetPos();<br />
			break;<br />
		case TB_PAGEUP:<br />
			si.nPos -= 5;<br />
			i = m_Slider.GetPos();<br />
			break;<br />
		case TB_THUMBTRACK:<br />
			i = m_Slider.GetPos();<br />
			si.nPos = i*10;<br />
			break;<br />
	};<br />
<br />
	si.fMask = SIF_POS;<br />
<br />
	if( iScrollPos != si.nPos )<br />
	{<br />
		m_ScrollBar.SetScrollInfo( &si );<br />
		UpdateData();<br />
		m_HRuler.SetMilimeterPixel(i);		<br />
		m_HRuler.SetScrollPos( m_nScrolPos );			<br />
		m_HRuler.Invalidate();	<br />
	}<br />
<br />
	CDialog::OnHScroll(nSBCode, nPos, pScrollBar);<br />
}<br />

My Environment is : Windows Vista SP1, VS 2005 SP1, MS Platform SDK 2003 SP1

Thank you very much!
QuestionRemoving focus for an hyperlink control Pin
YKK Reddy5-Aug-08 7:38
YKK Reddy5-Aug-08 7:38 
AnswerRe: Removing focus for an hyperlink control Pin
hoxsiew5-Aug-08 8:38
hoxsiew5-Aug-08 8:38 
GeneralRe: Removing focus for an hyperlink control Pin
YKK Reddy5-Aug-08 19:55
YKK Reddy5-Aug-08 19:55 
QuestionHow to convert variant_t data type to char* or char array or const char* or CString data type? Pin
yklim5-Aug-08 6:05
yklim5-Aug-08 6:05 
AnswerRe: How to convert variant_t data type to char* or char array or const char* or CString data type? Pin
led mike5-Aug-08 7:00
led mike5-Aug-08 7:00 
AnswerRe: How to convert variant_t data type to char* or char array or const char* or CString data type? Pin
hoxsiew5-Aug-08 7:10
hoxsiew5-Aug-08 7:10 
AnswerRe: How to convert variant_t data type to char* or char array or const char* or CString data type? Pin
George L. Jackson5-Aug-08 7:43
George L. Jackson5-Aug-08 7:43 
QuestionDebug mode and Break Points Pin
john john mackey5-Aug-08 5:25
john john mackey5-Aug-08 5:25 
AnswerRe: Debug mode and Break Points Pin
Waldermort5-Aug-08 18:29
Waldermort5-Aug-08 18:29 
QuestionHide process Pin
Daniel Kanev5-Aug-08 5:02
Daniel Kanev5-Aug-08 5:02 
AnswerRe: Hide process Pin
Stephen Hewitt5-Aug-08 13:54
Stephen Hewitt5-Aug-08 13:54 
AnswerRe: Hide process Pin
Rajesh R Subramanian5-Aug-08 19:41
professionalRajesh R Subramanian5-Aug-08 19:41 
AnswerRe: Hide process Pin
Hamid_RT5-Aug-08 20:26
Hamid_RT5-Aug-08 20:26 
QuestionFind orphan functions and members, unused code Pin
AnotherFakeName5-Aug-08 5:01
AnotherFakeName5-Aug-08 5:01 
AnswerRe: Find orphan functions and members, unused code Pin
Waldermort5-Aug-08 18:32
Waldermort5-Aug-08 18:32 
QuestionGet service Name Pin
sunit55-Aug-08 3:50
sunit55-Aug-08 3:50 
AnswerRe: Get service Name Pin
Randor 5-Aug-08 7:19
professional Randor 5-Aug-08 7:19 

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.