Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Error creating OleControlSite
Error creating OleControlSite [message #451435] Wed, 02 March 2005 03:54 Go to next message
Eclipse UserFriend
Originally posted by: michael_bishop.rta.nsw.gov.au

Wondering if someone might be able to help me out with an OleClientSite
creation error:

I have a 3rd party .exe which registers itself as an OLEServer when it is
first run.
A simple Visual Basic program using this COM object runs correctly.
However the same code in Java, using SWT's OleClientSite, gives an
ERROR_CANNOT_CREATE_OBJECT error when it tries to instanciate the
OleClientSite object.

Would anyone know what is going wrong when I use OleClientSite ?
The Visual Basic code and equivalent Java code is attached.

Thankyou

Michael Bishop


**======================== VB Code
========================================**
Private Sub Form_Load()
Dim TMCVSClient As Object
Set TMCVSClient = CreateObject("TMCVSClient.TMCVSClientInterface")

Dim Result As Integer

Result = TMCVSClient.SelectCamera("1")

Set TMCVSClient = Nothing

End Sub

**========================= JAVA Code
====================================**
Shell shell = new Shell(display);
OleFrame frame = new OleFrame(shell, SWT.NONE);
OleControlSite controlSite = new OleControlSite(frame,
SWT.NONE,
"TMCVSClient.TMCVSClientInterface");
Re: Error creating OleControlSite [message #451456 is a reply to message #451435] Wed, 02 March 2005 16:26 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
OleControlSite is for ActiveX controls only. It does not support generic
COM objects. My guess is that you are getting the error "-2147483644 No
such interface supported" which probably means that the COM object you are
trying to embed does not support the minimal set of interfaces required by
an ActiveX control.

"Michael Bishop" <michael_bishop@rta.nsw.gov.au> wrote in message
news:d03de7$or4$1@www.eclipse.org...
>
> Wondering if someone might be able to help me out with an OleClientSite
> creation error:
>
> I have a 3rd party .exe which registers itself as an OLEServer when it is
> first run. A simple Visual Basic program using this COM object runs
> correctly. However the same code in Java, using SWT's OleClientSite, gives
> an ERROR_CANNOT_CREATE_OBJECT error when it tries to instanciate the
> OleClientSite object.
>
> Would anyone know what is going wrong when I use OleClientSite ?
> The Visual Basic code and equivalent Java code is attached.
>
> Thankyou
>
> Michael Bishop
>
>
> **======================== VB Code
> ========================================**
> Private Sub Form_Load()
> Dim TMCVSClient As Object
> Set TMCVSClient = CreateObject("TMCVSClient.TMCVSClientInterface")
> Dim Result As Integer
> Result = TMCVSClient.SelectCamera("1")
> Set TMCVSClient = Nothing
> End Sub
>
> **========================= JAVA Code
> ====================================**
> Shell shell = new Shell(display);
> OleFrame frame = new OleFrame(shell, SWT.NONE);
> OleControlSite controlSite = new OleControlSite(frame, SWT.NONE,
> "TMCVSClient.TMCVSClientInterface");
>
>
Re: Error creating OleControlSite [message #451560 is a reply to message #451456] Wed, 02 March 2005 23:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: michael_bishop.rta.nsw.gov.au

Thanks Veronika for the reply,

I have also tried using OleClientSite in place of OleControlSite and I get
the same error :

org.eclipse.swt.SWTException: Failed to create Ole Client. result =
-2147221164
at org.eclipse.swt.ole.win32.OLE.error(OLE.java:302)
at org.eclipse.swt.ole.win32.OleClientSite.<init>(OleClientSite.java:238)

Maybe what I am doing is incorrect because I just want to call methods of
the Ole Automation object - I don't need to display it in the GUI.

Do you know if Eclipse has support for using an ActiveX Control that
doesn't need to be embedded in a Frame ?

Cheers

Michael Bishop
Re: Error creating OleControlSite [message #451618 is a reply to message #451560] Thu, 03 March 2005 12:33 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
SWT does not have support for non-UI COm objects:

See:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=68194


"Michael Bishop" <michael_bishop@rta.nsw.gov.au> wrote in message
news:d05i0h$mve$1@www.eclipse.org...
> Thanks Veronika for the reply,
>
> I have also tried using OleClientSite in place of OleControlSite and I get
> the same error :
>
> org.eclipse.swt.SWTException: Failed to create Ole Client. result
> = -2147221164
> at org.eclipse.swt.ole.win32.OLE.error(OLE.java:302)
> at org.eclipse.swt.ole.win32.OleClientSite.<init>(OleClientSite.java:238)
>
> Maybe what I am doing is incorrect because I just want to call methods of
> the Ole Automation object - I don't need to display it in the GUI.
>
> Do you know if Eclipse has support for using an ActiveX Control that
> doesn't need to be embedded in a Frame ?
>
> Cheers
>
> Michael Bishop
>
>
Previous Topic:OleAutomation with Excel
Next Topic:Regarding Spinner widget in latest SWT swt-3.1M4-win32
Goto Forum:
  


Current Time: Tue Apr 16 04:36:42 GMT 2024

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

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

Back to the top