Link to home
Start Free TrialLog in
Avatar of tantormedia
tantormediaFlag for United States of America

asked on

mfc: CDHtmlDialog question

Dear expert,

I am working on an application that needs a functionality to compare two files content. I found code for an application that does it. That application renders the results in html format. But I need to be able to select random lines and process the content. So I was going to just redo the application to render the results in e.g. multiline Edit control. But I bumped into CDHtmlDialog. I have never used it, but it seems that it could allow me to render my html in it. Could you please tell me if that dialog will allow me to select lines and get the selected content etc.? Maybe you could give me even an exampe?
Thanks.
Avatar of sarabande
sarabande
Flag of Luxembourg image

what is the connection between files to compare and html dialog? are the files html code? are the lines to compare lines of the (text) files or visible text of a web page or web control?

Sara
Avatar of tantormedia

ASKER

I wrote about comparing texts only to give the general context of my work. The files are not html code, but the result is rendered as html in a browser. Instead, it should be rendered somehow in a dialog box so that the user could select lines and accept or reject changes of random lines.
I guess I would have to use just two listboxes...
ASKER CERTIFIED SOLUTION
Avatar of sarabande
sarabande
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sara, I was thinking about CListCtrl, but not sure if it could handle very long lines. With CListBox, I know how to add horizontal scroll.
Also, I need to have lines of either text or backrgound of different colors based of kind of change detected, if any, e.g. Green for added, Red for deleted, Yellow for modified.
you can resize the list control column widths by mouse  and have a horizontal scroll as well. however that is only practical if you not really need to see all text in most cases.

another thought is to have two static text controls with horizontal scrollbar  and no verical scrollbar on them. then add a separate vertical scrollbar as an own control where you would do the vertical scrolling for both textboxes yourself.

Sara
Two static text controls will not let me select randorm records... Or add line numbers, as you said...
i once made a own tree control and base class was owner-draw CListBox if i remember correctly. i mean to remember that i added ON_WM_VSCROLL to message map of the control which would need an override of the

   afx_msg void OnVScroll( UINT nSBCode, UINT nPos, CScrollBar* pScrollBar );

you might try whether you get this message handler being called.

Sara