Results 1 to 2 of 2

Thread: How to correctly dispose of an controls in an ocx

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2013
    Posts
    2

    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
  •  



Click Here to Expand Forum to Full Width