Error creating OleControlSite [message #451435] |
Wed, 02 March 2005 03:54 |
Eclipse User |
|
|
|
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 #451560 is a reply to message #451456] |
Wed, 02 March 2005 23:25 |
Eclipse User |
|
|
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03418 seconds