Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在java的非UI线程中使用OleFrame?_Java_Swt_Ui Thread - Fatal编程技术网

如何在java的非UI线程中使用OleFrame?

如何在java的非UI线程中使用OleFrame?,java,swt,ui-thread,Java,Swt,Ui Thread,你能告诉我怎么使用吗 org.eclipse.swt.ole.win32.OleFrame 在非UI线程中? 如果在非UI线程抛出中创建“OleFrame”。 我知道UI线程和非UI线程的区别。 我试图实现的是在“IRunnableWithProgress”中使用org.eclipse.swt.ole.win32.OleAutomation 添加 for(;mShell.getDisplay().readAndDispatch();); (mShell在构造函数中给出)每次OLE调用后都会有

你能告诉我怎么使用吗

org.eclipse.swt.ole.win32.OleFrame
在非UI线程中? 如果在非UI线程抛出中创建“OleFrame”。 我知道UI线程和非UI线程的区别。 我试图实现的是在“IRunnableWithProgress”中使用
org.eclipse.swt.ole.win32.OleAutomation

添加

for(;mShell.getDisplay().readAndDispatch(););
mShell
在构造函数中给出)每次OLE调用后都会有一些帮助,但还不够

任何帮助都将不胜感激

OutlookHelper outlook = new OutlookHelper(mShell, mModel.getEmailToAddresses(), "Feedback report", emailInfo.body, attachment);
new ProgressMonitorDialog(mShell).run(true, false, outlook);

public class OutlookHelper implements IRunnableWithProgress {
    public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
        monitor.beginTask("Sending...", IProgressMonitor.UNKNOWN);
        send(monitor);      
        monitor.done();
    }

    private void send(IProgressMonitor monitor) throws InterruptedException {

        monitor.subTask("Creating OLE frame");
        // Will block UI thread here ...
        final OleFrame frame = new OleFrame(mShell, SWT.NONE);

        monitor.subTask("Starting Outlook application");
        // Will block UI thread here ...
        OleClientSite site = new OleClientSite(frame, SWT.NONE, "Outlook.Application");
        ...
    }   
}