[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Embedded Contents: SWT OLE into Canvas

I am trying to use a swt ole component into my awt application.

My code:

Frame f = new Frame( "Example" );
Canvas c1 = new Canvas();
f.add(c1);
f.show();
Display display = new Display();
SWT_AWT a1 = new SWT_AWT();
Shell shell=	SWT_AWT.new_Shell(display,c1);
OleFrame oleFrame = new OleFrame(shell, SWT.NONE);
OleControlSite oleControlSite;
oleControlSite = new OleControlSite(oleFrame, SWT.NONE, "Shell.Explorer");
oleControlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);

That works fine... the problem is that in my appication I can not use a Frame I need to put the canvas over a awt.Panel:

Frame f = new Frame( "Example" );
Canvas c1 = new Canvas();
Panel p1 = new Panel();
p1.add(c1);
f.add(p1);
f.show();
Display display = new Display();
SWT_AWT a1 = new SWT_AWT();
Shell shell=	SWT_AWT.new_Shell(display,c1);
OleFrame oleFrame = new OleFrame(shell, SWT.NONE);
OleControlSite oleControlSite;
oleControlSite = new OleControlSite(oleFrame, SWT.NONE, "Shell.Explorer");
oleControlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);

BUT IT DOESN'T WORK .... ANY IDEA?