|
-
Jun 6th, 2013, 09:34 AM
#1
Thread Starter
New Member
How to correctly dispose of an controls in an ocx
Hi all, I have developed an OCX that contains 3 webbrowser controls, and 3 frames. I am dynamically adding the webbrowser controls to the frames at runtime using
Set WebBrowser2 = Controls.Add("Shell.Explorer.2", "WebBrowser2", Frame2)
However when I add my ocx to word document, I get an error when I close the document. The error isn't very informative:
AppName: winword.exe AppVer: 9.0.0.2717 ModName: msvbvm60.dll
ModVer: 6.0.98.2 Offset: 00048991
I reckon it's because I am not correctly disposing of some of the controls. The question is, when do I dispose of the Webbrowser and Frame control? In the usercontrol_terminate event?
Thanks
Last edited by meljunk; Jun 6th, 2013 at 09:55 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|