DesktopHTMLViewer bug - handle not an integer

The .handle propoerty for an HTMLViewer (API1 or API2) is supposed to be an integer - documented as such. But the compiler insists that, for API2, it is a Ptr (pointer). Anyone else seen this?

Edit: <https://xojo.com/issue/66815>

I think its like that on all the new Desktop controls. So probably more likely to be documentation bug.

Humph. That would be a problem for a declare that I use, if so.

Integer and Ptr are basically the same thing; it shouldn’t cause problems to change a declare to use one over the other.

Thanks - that seemed to work. I say seemed as with declares, I’m just fiddling with someone else’s recipe.

Or you could cast it to an Integer and leave the declare as is:

Integer(Me.Handle)

The declare uses the result of me.handle, so I have to mod the declare method either way. I changed it to use Ptr and ran it with my app. It’s a method that @Sam_Rowlands kindly provided, which obtains permission for an HTMLViewer to load local images. It’s undoing a security blockage Apple created a while ago.

2 Likes

Modifying the declare or using the method suggested by @anon20074439 will work.

I am slowly going through all 3,000 + declares in the Ohanaware App Kit and modifying them so that they’ll still work “Controls” and the newly renamed “DesktopUIControls”.

The convenience functions and convenience classes are a whole different bag of pain, some I can solve by passing the handle (and using the trick suggested by @anon20074439 for DesktopUIControls), while others are proving quite difficult to solve.