Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - CXTPPreviewCtrl does not "scroll" to the top
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPPreviewCtrl does not "scroll" to the top

 Post Reply Post Reply
Author
Message
docontrol View Drop Down
Groupie
Groupie


Joined: 07 December 2009
Location: Denmark
Status: Offline
Points: 35
Post Options Post Options   Thanks (0) Thanks(0)   Quote docontrol Quote  Post ReplyReply Direct Link To This Post Topic: CXTPPreviewCtrl does not "scroll" to the top
    Posted: 10 August 2021 at 1:38pm
I have implemented the new CXTPPreviewCtrl control in a project and noticed afterward that previewing Microsoft Word documents (docx) does not always start at the top of the content. The behavior seems quite random, and previewing the same document might sometimes work. The scroll bars, however, indicate that the content location is at the top. Clicking in the preview window triggers a window refresh, after which the content looks okay.

The behavior is the same in the WinExplorer Sample, so you should be able to replicate it.

To be more accurate, I briefly (less than 1 second) see the preview content generate correctly, and then it changes the location in the content a few blocks down. It might simply be a sample code error.

The "real" Windows Explorer preview works fine on the same documents, so it is not a Microsoft issue.

To rule out issues related to Visual Studio, I also downloaded the Live example from codejock.com, which behaves the same way.
Back to Top
docontrol View Drop Down
Groupie
Groupie


Joined: 07 December 2009
Location: Denmark
Status: Offline
Points: 35
Post Options Post Options   Thanks (0) Thanks(0)   Quote docontrol Quote  Post ReplyReply Direct Link To This Post Posted: 17 August 2021 at 3:26am
It turns out that the "real" Windows Explorer behaves roughly the same. Sometimes document previews load fine, and other times they skip the first paragraph of the document. Clicking on the preview or scrolling causes the preview to refresh and display correctly.

That leads me to another request. Since clicking on the preview seems to resolve the problem, isn't there some way to code a workaround? 

I have successfully used "UINT SendInput(UINT cInputs, LPINPUT pInputs, int cbSize)" to click on the preview, which works quite well. Of course, I would prefer a method that does not move the mouse cursor, but using SendMessage/PostMessage doesn't seem to work for me.

In my case, CXTPPreviewCtrl is placed in a docking pane, and dragging the pane also leads to a refresh of the preview content. I have also tried to do that programmatically, but so far, no success.

Any suggestions?
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.