Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] Re: Re: How to stop an ActiveX Control in SWT properly?

Hoi,

i use the swing/ SWT bridge in order to integrate win32 applications
into a plugin based swing application.

the plugin will be initialised like follows:

		shell = SWT_AWT.new_Shell(getDisplay(), getActiveXCanvas());
		shell.setLayout(new FillLayout());

		// create OLE frame and IExplore control
		oleFrame = new OleFrame(shell, SWT.NONE);
		win32Control = new OleControlSite(oleFrame, SWT.NONE, "Shell.Explorer");
		shell.open();

the content will be loaded when display stuff has been initialised:

		// activate control (OleControlSite 'win32Control' has been created
before)
		win32Control.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);

		OleAutomation anOleControlObject = new OleAutomation(win32Control);
		Variant[] aControlArgList = new Variant[1];
		Variant aControlArgument = new Variant(inId.toString());
		aControlArgList[0] = aControlArgument;
		anOleControlObject.invoke(500, aControlArgList);

		// new: dispose automation object
		anOleControlObject.dispose();

when stopping the plugin the following code will be executed:

		oleFrame.dispose();
		win32Control.deactivateInPlaceClient();
		win32Control.dispose();
		UCSwtUiThread.destroy();
		display.dispose();

adding the new line which disposes the automation object did not affect
the win32 process at all.

how can a variant be disposed by the way?

thanks.

cheers,
chris

> To: platform-swt-dev@xxxxxxxxxxx
> Subject: Re: [platform-swt-dev] How to stop an ActiveX Control in
> SWT properly?
> From: Veronika Irvine <Veronika_Irvine@xxxxxxxxxx>
> Date: Thu, 28 Aug 2003 09:26:30 -0400
> Reply-To: platform-swt-dev@xxxxxxxxxxx
>
> oleControlSiteObject.deactivateInPlaceClient() just places the control in
> an inactive state - it does not terminate it.
> oleControlSiteObject.dispose() calls
> oleControlSiteObject.deactivateInPlaceClient() and calls Release on any
> COM interfaces it has aquired.
>
> Releasing all the COM interface should be enough to terminate the
> process,
> however, it is possible that some COM interfaces are not being fully
> released (i.e. to a RefCount of 0).  If you have created an OleAutomation
> object, you must dispose it when done with it.  If you have created a
> Variant (or received a Variant in an event or method invocation) you need
> to dispose the Variant.
>
> Please provide an example to show the failure you are seeing.
>
>
>
>
>
> "Christian Sauer" <christian.sauer@xxxxxxxxxxxxx>
> Sent by: platform-swt-dev-admin@xxxxxxxxxxx
> 08/25/2003 04:51 AM
> Please respond to platform-swt-dev
>
>         To:     <platform-swt-dev@xxxxxxxxxxx>
>         cc:
>         Subject:        [platform-swt-dev] How to stop an ActiveX Control
> in SWT properly?
>
>
> Hi all,
>
> is it possible to explicitly end a win32 process which has been
> started before by embedding an activeX control (e.g. Excel)?
>
> calling 'oleControlSiteObject.dispose()' and
> 'oleControlSiteObject.deactivateInPlaceClient()'
> does not end the process.
>
> thanks for a hint,
> chris
> -------------------------------------------------------------------------
> Giniality AG - Christian Sauer; Steinenberg 21, CH-4051 Basel
> Phone: +41 61 226 99 66; Fax: +41 61 226 99 69;
> E-Mail: xxx; WWW: http://www.giniality.com



Back to the top