Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 211663 - [OLE] ActiveX/OLE Document support not working correctly in 3.4M3
Summary: [OLE] ActiveX/OLE Document support not working correctly in 3.4M3
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M4   Edit
Assignee: Duong Nguyen CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-30 19:57 EST by Paul Watson CLA
Modified: 2008-01-11 17:24 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Watson CLA 2007-11-30 19:57:47 EST
Hi,

I use a 3rd party chemical structure drawing ActiveX component in an eclipse RCP application. This has worked really well in the past (up to and including version 3.3). On trying version 3.4M3 I found that the ActiveX component no longer appears and I get no errors. Here is a snippet. This runs perfectly under 3.3, but for 3.4M3 this simply opens an empty shell with no errors. 

import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTError;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.ole.win32.OLE;
import org.eclipse.swt.ole.win32.OleControlSite;
import org.eclipse.swt.ole.win32.OleFrame;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class ChemicalStructureActiveXTest {
    public static void main(String[] args) {
        Display display = new Display();
        Shell shell = new Shell(display);
        shell.setText("Chemical Structure ActiveX Example");
        shell.setLayout(new FillLayout());
        try {
            OleFrame frame = new OleFrame(shell, SWT.NO_BACKGROUND);
            OleControlSite site = new OleControlSite(frame, SWT.NONE,
                    "{60257C74-D60B-41D6-9296-A08BD51F15B5}");
            int ok = site.doVerb(OLE.OLEIVERB_SHOW);
            if (ok == OLE.S_OK) {
                System.out.println("Was OK apparently");
            } else {
                System.out.println("Was NOT OK apparently");
            }
        } catch (SWTError e) {
            System.out.println("Unable to open activeX control");
            return;
        }
        shell.setSize(800, 600);
        shell.open();
       
        while (!shell.isDisposed()) {
            if (!display.readAndDispatch())
                display.sleep();
        }
        display.dispose();
    }
} 

You can download the 3rd part chemical drawing plugin here (click on the free windows download button on the RHS). Simply run the installer to install the software.

http://scistore.cambridgesoft.com/software/product.cfm?pid=4012

After you have installed this, run the snippet I provided in version 3.3 and 3.4M3. Under 3.3 everything works you should get a white drawing area and popup toolbar should appear. Under 3.4M3 it doesn't seem to work. 

Can you replicate the behavior I am seeing? 

Many thanks,

Paul Watson
Comment 1 Steve Northover CLA 2007-12-01 10:03:53 EST
Duong, please fix this right away.  It is a regression, possibly caused by the refactoring you did around OLE insets.  I don't want to ship 3.4 breaking this guy.
Comment 2 Duong Nguyen CLA 2007-12-03 19:28:20 EST
Fixed > 071203

The problem was introduced when Bug 173556 was fixed.

When we create the site, we now pass the OleClientSite to make WMPlayer work. I thought it was not necessary to set the clientSite again later in our code when we initialize the OleObject. This was wrong since some apps still require the clientSite to be set later and not during creation. Adding back the setting of the clientSite when the OleObject is initialized.

	objIOleObject.SetClientSite(iOleClientSite.getAddress());