I need to create Visual Studio Editor look-alike : 3 columns for Line Number, Breakpoint bitmap, and Text Editor...

To do this, the current structure is using three object derived from CRichEditCtrl (called it CDebugEditCtrl).

The problem is with Horizontal scrolling. I want to create horizontal scroll to cover all the three controls. So I created CSCrollBar Object and re-route all messages to my CDebugEditCtrl handler, which will subsequently call the base class function. I also set the scroll position manually for every message. This works OK.

The main problem is with synchronization between CDebugEditCtrl and CSCrollBar. As you know, some default action will automatically scroll CDebugEditCtrl. My problem, selecting the text horizontally past over the edge will cause automatic scrolling, but the scroll position does not follow.

I want to manually re-position the scroll, but unable to get accurate method to determine the scroll position.

Any of you could give me any advise ?
When using CScrollBar, is it really necessary to handle all messages and details one by one ? Is there any shortcut to 'link' CScrollBar and the Control ?

~the noobz~