Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] OleControlSite bug?

public static void main(String[] args) {
	final Display display = new Display();
	Shell shell = new Shell(display);
	shell.setLayout(new FillLayout());
	OleClientSite controlSite;
	try {
		OleFrame frame = new OleFrame(shell, SWT.NONE);
		controlSite = new OleClientSite(frame, SWT.NONE,
"Word.Document");
		controlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
	} catch (SWTError e) {
		System.out.println("Unable to open activeX control");
		return;
	}
	shell.open();
	
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch())
			display.sleep();
	}

	display.dispose();
}

The above is a simple program I copied from swt sample and made some
change.
The result is in attached file: 1.jpg

But if I change it to:
controlSite = new OleControlSite(frame, SWT.NONE, "Word.Document");

the result is not good, see attached file: 2.jpg
There is some empty space between the toolbar and the word content!

Is this an OleControlSite bug?

BTW, if I want to the result don't have the toolbar (same as when word
is embedded in IE), how can I do that?

Thanks.

jml

Attachment: 1.jpg
Description: JPEG image

Attachment: 2.jpg
Description: JPEG image


Back to the top