Visio Guy

Visio Discussions => Programming & Code => Topic started by: joules on July 04, 2008, 11:24:21 AM

Title: Exception while using Visiocontrol in a child form
Post by: joules on July 04, 2008, 11:24:21 AM
I'm using a third party control to create child form to the existing form.The child form has visio control added to it.But whenever i try to access axdrawingcontrol.window property it throws an exception :
Exception from HRESULT: 0x80070006 (E_HANDLE). The code works fine if the visio control belongs to the parent form.Can anyone tell what could possibly be the reason for this exception
Title: Re: Exception while using Visiocontrol in a child form
Post by: Visio Guy on July 04, 2008, 07:33:52 PM
joules,

No idea why this happens, but let me ask: does this happen at design time, or are you creating it on the fly?

And if it is a design-time problem, try adding a new Visio control to your child form programmatically, and see if you can get that to work.

Early versions of the Visio control used to crash and disappear from the designer, so I resorted to always creating the Visio control programatically for a while. Might be worth a shot.
Title: Re: Exception while using Visiocontrol in a child form
Post by: joules on July 10, 2008, 09:51:15 AM
The code started working when i moved it to the constructor for the child form.Earlier i had written it in  the formload method for the child form. But still some of the properties are not working here also.Like if i set the zoom property to a specific value, appearance changes accordingly.But when i try setting the properties to disable scrollbars and all though the value of the property changes it has no effect on the appearance.