TWebBrowser - Trying to fix the “Invalid floating point operation” error

…衆ロ難τιáo~ 提交于 2019-12-13 01:29:35

问题


The TWebBrowser component has an error as described here [IE9] 'Floating point division by zero' occurs with WebBrowser. The solution is to call a procedure that will disable all division by zero exceptions. I am trying to fix this problem without having to call this procedure.

So far, the best idea I had was to disable TWebBrowser scroll bars and try to simulate the same functionality using a TScrollBar. So far, it is working but that is the question:

How can I synchronize the navigation in the TWebBrowser with TScrollBar? I need to intercept scroll messages of TWebBrowser and send them to TScrollBar in order to keep the bar synchronized with the document that is being show. Does anyone knows how to do that?

To be more clear: I need an way of telling TScrollBar what is its position relative to the position of the cursor in the TWebBrowser.

I am using Delphi 2010.


回答1:


I don't believe it is worthwhile to try. The scrolling in IE is going to happen with or without its scroll bars being visible ... using your TScrollbar is apparently going to scroll the browser which in turn is assumedly going to generate the same exact error. I don't know the internals of IE to know where exactly this floating point error surfaces...

Are you after all scroll bars, or just the outer one? What about internal content that is scrolled, such as an embedded frame? Do the other internal scroll bars on a document generate the same error? If they do, then you'll be chasing your tail for quite a while trying to out-do IE on all it's scrollable content.

The fix is provided, and tested. Sorry, but I'd use the suggested fix.



来源:https://stackoverflow.com/questions/11869023/twebbrowser-trying-to-fix-the-invalid-floating-point-operation-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!