Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » word-application hangs while running ole-element in background.
word-application hangs while running ole-element in background. [message #630854] Tue, 05 October 2010 10:36
Luke Mising name is currently offline Luke Mising nameFriend
Messages: 7
Registered: October 2010
Junior Member
Hi,

i've created an ole-frame and clientsite to import and execute a makro inside a word-application. When is try to run the macro (it takes up to 5 min. to execute it) inside the native OleEditor of eclipse the operation will finish successfully. The code does look like this:

OleEditor editor = (OleEditor) IDE.openEditor(window.getActivePage(), job.getTemplate());
		
editor.showBusy(true);
InteropHelper.importAndRun(editor.getClientSite(),job.getMakro().getAbsolutePath());

if(editor.isDirty())
	editor.doSaveAs();


This operation will block the Ui for up to 5 minutes.Because of this i tried to execute the makro "in background".

The code does look like this:

final Display display = window.getWorkbench().getDisplay();
		
		
		display.asyncExec(new Runnable() {
			
			@Override
			public void run() {

OleFrame frame = new OleFrame(shell, SWT.MODELESS);
				shell.setVisible(false);
				monitor.subTask("Creating Word-bridge");
				OleClientSite clientSite = new OleClientSite(frame, SWT.NULL, new File(openFilename));
				clientSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
				monitor.worked(1);
				
				monitor.subTask("Handle word application");
				InteropHelper.handleWord(clientSite);
				monitor.worked(1);

				monitor.subTask("Import and running makro (this will take a couple of minutes)");
				InteropHelper.importAndRun(clientSite, makro.getAbsolutePath());
				monitor.worked(1);

...


My problem is now that in the secound solution the Word-Application in background stops working for no reason!

I tried to figure out at which point the execution stops and it seems that it stop at the vb-code which moved the cursor in a loop. The code looks like this. Could it be that the ole-bridge has some problems with it? When i move the cursor a single line the code continuous...
Previous Topic:Is there any way to Rotate a widget.
Next Topic:context menu appears on mouseUp under Windows, but on mouseDown under Mac OS
Goto Forum:
  


Current Time: Fri Apr 26 23:56:00 GMT 2024

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

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

Back to the top