Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » ActiveX closing extremly slow
ActiveX closing extremly slow [message #448178] Tue, 04 January 2005 22:47
Bernd Hofner is currently offline Bernd HofnerFriend
Messages: 68
Registered: July 2009
Member
To solve my problem concerning displaying PDF files I tried to use the Adobe
Acrobat ActiveX control (quick-and-dirty):

public class ToolFrameEditor extends MultiPageEditorPart
{

void addPages() {
OleFrame frame = new OleFrame(getContainer(), SWT.NONE);
controlSite = new OleControlSite(frame, SWT.NONE, "PDF.PdfCtrl.5");
controlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
OleAutomation automation = new OleAutomation(controlSite);

int[] rgdispid = automation.getIDsOfNames(new String[]{"LoadFile"});

int dispIdLoadFile= rgdispid[0]; // id for VARIANT_BOOL
LoadFile(BSTR FileName) method
Variant args[]= new Variant[1];
args[0]= new Variant(myFileName);
Variant result= automation.invoke(dispIdLoadFile, args);

idxPDFPage= addPage(frame);
setPageText(idxPDFPage, "PDF Aufbauplan");

automation.dispose();
...

which works quite nice, except some drawbacks:

a) it seems not possible to use the version independend ProgId (PDF.PdfCtrl)
to instantiate the OleControlSite, which ties
me to a specific version of the Adobe Acrobat Control (V5 in this case),
which I might work around with some try and error
testing using different version numbers in the ProgId.

b) CLOSING an editor that contains such a control takes ages: about 20
seconds on my 900MHz/512MB laptop without any
pronouniciated disk activity (swapping et al). Note that opening the
editor took about 4 seconds for the first time and
about a second for another editor instance (Well I didn't switch over to
Acrobat 6, yet, which might take 2 minutes for opening instead ;-))

Has anyone an idea why closing the ActiveX might take so long and how I
could quicken the pace somewhat?

c) I don't like to mix Java and ActiveX technologies

Thanks,

Bernd
Previous Topic:SWT Shell or JFace Window ?
Next Topic:Opening and closing a view programmatically
Goto Forum:
  


Current Time: Sun Oct 25 04:24:05 GMT 2020

Powered by FUDForum. Page generated in 0.02004 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top