DropTarget cleanup (COM-level) does not seem to be complete (org.eclipse.swt.SWTError: Cannot initia [message #448395] |
Fri, 07 January 2005 19:07 |
Eclipse User |
|
|
|
Originally posted by: roberto.nucera.informatica.com
This problem has been reported sometime ago 22 May 2004.
I have run in exactly the same issue with trying to test SWT apps with
Junit.The second time I start the fixture
we get "org.eclipse.swt.SWTError: Cannot initialize Drop".
Any ideas?
Problem:
--------
DropTarget cleanup (COM-level) does not seem to be complete. Instantiating
another DragDrop instance within the same process
fails after calling CoLockObjectExternal COM API.
org.eclipse.swt.SWTError: Cannot initialize Drop
at org.eclipse.swt.dnd.DND.error(DND.java:220)
at org.eclipse.swt.dnd.DND.error(DND.java:181)
at org.eclipse.swt.dnd.DropTarget.<init>(DropTarget.java:133)
at
org.eclipse.swt.examples.dnd.DNDExample.createDropTarget(DND Example.java:640
)
at org.eclipse.swt.examples.dnd.DNDExample.access$2000(DNDExamp le.java:21)
at
org.eclipse.swt.examples.dnd.DNDExample$25.widgetSelected(DN DExample.java:83
9)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:89)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:769)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2578)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2256)
at org.eclipse.swt.examples.dnd.DNDExample.open(DNDExample.java :1101)
at org.eclipse.swt.examples.dnd.DNDExample.access$000(DNDExampl e.java:21)
at org.eclipse.swt.examples.dnd.DNDExample$1.run(DNDExample.jav a:67)
at java.lang.Thread.run(Thread.java:534)
Environment:
------------
Windows XP Pro 2002 SP1
SWT M08
j2sdk1.4.2_03
Steps to reproduce:
------------------
1. Modify DNDExample.java (SWT sample), main() method as shown below, so
that
it displays two Shell instances, one after another:
public static void main(String[] args) throws Exception{
//fisrt instance works OK
DNDExample example = new DNDExample();
example.open();
//second instance has problems with DropTarget initialization
//for cleaner experiment, let's use another UI thread
Runnable runnable = new Runnable() {
public void run() {
DNDExample example2 = new DNDExample();
example2.open();
}
};
new Thread(runnable).start();
Thread.sleep(Long.MAX_VALUE);
}
2. Run DNDExample, make sure example Shell is displayed.
3. Click on DropTarget check box, which causes creation of DropTarget
associated with Label control.
4. Close the Shell, which causes disposal of Label control and associated
DropTarget. When DropTarget refCount becomes 0, disposeCOMInterfaces()
method is called, which should completely release all system resources
associated with DropTarget.
5. Make sure example2 Shell instance is displayed.
6. Click on DropTarget check box, which should create another DropTarget
instance. Instead, SWT fails with stack trace provided above.
|
|
|
Re: DropTarget cleanup (COM-level) does not seem to be complete (org.eclipse.swt.SWTError: Cannot in [message #448400 is a reply to message #448395] |
Fri, 07 January 2005 21:25 |
Veronika Irvine Messages: 1272 Registered: July 2009 |
Senior Member |
|
|
You are creating two UI threads in the same application. In 3.0, this is
not supported for DND. In 3.1, it is supported.
"Roberto Nucera" <roberto.nucera@informatica.com> wrote in message
news:crmml6$dnm$1@www.eclipse.org...
> This problem has been reported sometime ago 22 May 2004.
> I have run in exactly the same issue with trying to test SWT apps with
> Junit.The second time I start the fixture
> we get "org.eclipse.swt.SWTError: Cannot initialize Drop".
>
> Any ideas?
>
> Problem:
> --------
> DropTarget cleanup (COM-level) does not seem to be complete. Instantiating
> another DragDrop instance within the same process
> fails after calling CoLockObjectExternal COM API.
>
> org.eclipse.swt.SWTError: Cannot initialize Drop
> at org.eclipse.swt.dnd.DND.error(DND.java:220)
> at org.eclipse.swt.dnd.DND.error(DND.java:181)
> at org.eclipse.swt.dnd.DropTarget.<init>(DropTarget.java:133)
> at
> org.eclipse.swt.examples.dnd.DNDExample.createDropTarget(DND Example.java:640
> )
> at org.eclipse.swt.examples.dnd.DNDExample.access$2000(DNDExamp le.java:21)
> at
> org.eclipse.swt.examples.dnd.DNDExample$25.widgetSelected(DN DExample.java:83
> 9)
> at
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:89)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:769)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2578)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2256)
> at org.eclipse.swt.examples.dnd.DNDExample.open(DNDExample.java :1101)
> at org.eclipse.swt.examples.dnd.DNDExample.access$000(DNDExampl e.java:21)
> at org.eclipse.swt.examples.dnd.DNDExample$1.run(DNDExample.jav a:67)
> at java.lang.Thread.run(Thread.java:534)
>
> Environment:
> ------------
> Windows XP Pro 2002 SP1
> SWT M08
> j2sdk1.4.2_03
>
> Steps to reproduce:
> ------------------
> 1. Modify DNDExample.java (SWT sample), main() method as shown below, so
> that
> it displays two Shell instances, one after another:
> public static void main(String[] args) throws Exception{
> //fisrt instance works OK
> DNDExample example = new DNDExample();
> example.open();
>
> //second instance has problems with DropTarget initialization
> //for cleaner experiment, let's use another UI thread
> Runnable runnable = new Runnable() {
> public void run() {
> DNDExample example2 = new DNDExample();
> example2.open();
> }
> };
> new Thread(runnable).start();
>
> Thread.sleep(Long.MAX_VALUE);
> }
>
> 2. Run DNDExample, make sure example Shell is displayed.
> 3. Click on DropTarget check box, which causes creation of DropTarget
> associated with Label control.
> 4. Close the Shell, which causes disposal of Label control and associated
> DropTarget. When DropTarget refCount becomes 0, disposeCOMInterfaces()
> method is called, which should completely release all system resources
> associated with DropTarget.
> 5. Make sure example2 Shell instance is displayed.
> 6. Click on DropTarget check box, which should create another DropTarget
> instance. Instead, SWT fails with stack trace provided above.
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02207 seconds