I'm programming activex component and adding it to html with object-tag. Is there a way to modify the height of this component dynamically, based on the contents (of activex)? Should I somehow call javascript code from inside c++ code, and ask javascript to resize object-element using DOM?
Asked
Active
Viewed 1,169 times
1 Answers
0
That would probably be the easiest way to do it; You can find out how to get a IHtmlElement reference to your object tag here: How to get a IHTMLElement pointer to the <object> tag hosting an activex control
You should then be able to set the width and height. Another (easier) option would be to set the width and height of your activex control to 100% and put it inside a div; then pass the id of the div into your activex control and use that to get the element by ID and resize that. Sometimes modifying the size of an object tag can act in unexpected ways.
FireBreath would abstract a lot of this for you and make it work on other browsers in addition; is there a reason you're doing this all by hand?
-
for some reason it was easier to find c++ activex code and make it run in firefox. didnt find good enought examples from firebreath site. i can be wrong – AareP Aug 09 '11 at 16:48
-
the main reason there aren't many examples on the firebreath site is that you don't need them; it's really easy to use. Try it. =] – taxilian Aug 09 '11 at 16:54
-
Also I only have so much time to write examples; users contribute most of the examples. Feel free to contribute more ;-) – taxilian Aug 09 '11 at 17:00
-
always learned programming from examples. would rather not read any manuals. :-) – AareP Aug 09 '11 at 17:05
-
good -- there aren't any. Check out the FBTestPlugin example, everything you need is there, other than what will be generated by fbgen which you only have to read one page to figure out. Use the search feature -- it's your friend. With that philosophy you're insane to try to do it in ActiveX directly. – taxilian Aug 09 '11 at 17:13
-
Will do, thanks. Btw one thing that might help spreading your software is adding article to codeproject.com. It's really nice how they package everything into minimalistic ready-to-use packages. No need for git, cmake, perl etc. Just download, compile and execute. – AareP Aug 09 '11 at 18:33
-
@AareP let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/2292/discussion-between-taxilian-and-aarep) – taxilian Aug 09 '11 at 18:55