Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How put an OleControlSite in read-only
How put an OleControlSite in read-only [message #372086] Tue, 29 July 2003 08:30 Go to next message
Eclipse User
Originally posted by: asra.choukri.hyperoffice.fr

Hi,

I try to put my OleControlSite in read-only.
In fact, I use the "DHTMLEdit.DHTMLEdit" programme Id to write HTML Text.
After, I would like to prohibit my user to write in my HTML editor.

Any ideas?

Thanks .
Asra.



Here my code:

/*****************************************/
import org.eclipse.swt.SWT;

import org.eclipse.swt.layout.RowLayout;

import org.eclipse.swt.ole.win32.OLE;

import org.eclipse.swt.ole.win32.OleAutomation;

import org.eclipse.swt.ole.win32.OleControlSite;

import org.eclipse.swt.ole.win32.OleFrame;

import org.eclipse.swt.ole.win32.Variant;

import org.eclipse.swt.widgets.Display;

import org.eclipse.swt.widgets.Shell;



public class ReadOnlyOle {

public static void main (String [] args) {

Display display = new Display ();

Shell shell = new Shell (display);

RowLayout fl = new RowLayout();

shell.setLayout(fl);



OleFrame oleFrameHtml = new OleFrame(shell,
SWT.BORDER);

OleControlSite controlSiteHtml = new OleControlSite(oleFrameHtml, SWT.NONE,
"DHTMLEdit.DHTMLEdit");

controlSiteHtml.setSize(200, 200);

controlSiteHtml.doVerb(OLE.OLEIVERB_SHOW);

OleAutomation automationHtml = new
OleAutomation(controlSiteHtml);





int[] rgids =
automationHtml.getIDsOfNames(new String[] {"DocumentHTML"});

Variant returned =
automationHtml.getProperty(rgids[0]);

Variant[] rgvars = new Variant[1];

rgvars[0] = new Variant("my text HTML");

automationHtml.setProperty(rgids[0], rgvars);



///PUT MY OLECONTROLSITE in READ-ONLY
.....????



shell.pack ();

shell.open ();

while (!shell.isDisposed ()) {

if (!display.readAndDispatch
()) display.sleep ();

}

display.dispose ();



}


}

/*****************************************/
Re: How put an OleControlSite in read-only [message #372088 is a reply to message #372086] Tue, 29 July 2003 09:12 Go to previous messageGo to next message
Eclipse User
Originally posted by: asra.choukri.hyperoffice.fr

I know that I can cast my OleControlSite in Composite and to put it
enabled(false). But, by doing that, I loses the listeners (keylistener,
mouselistener). Is there a solution which enables me to keep the listeners?

Thank you in advance!


"asra" <asra.choukri@hyperoffice.fr> a
Re: How put an OleControlSite in read-only [message #372107 is a reply to message #372086] Tue, 29 July 2003 14:15 Go to previous messageGo to next message
Eclipse User
Originally posted by: steve_northover.ca.ibm.com

You could try one of the standard OLE properties and hope that your control
supports it.
http://msdn.microsoft.com/library/default.asp?url=/library/e n-us/com/htm/ole
ctrl_32r7.asp

You can look at the API of DHTMLEdit and see of a non-standard property or
IDispatch does what you want.

"asra" <asra.choukri@hyperoffice.fr> wrote in message
news:bg5bb7$hjk$1@eclipse.org...
> Hi,
>
> I try to put my OleControlSite in read-only.
> In fact, I use the "DHTMLEdit.DHTMLEdit" programme Id to write HTML Text.
> After, I would like to prohibit my user to write in my HTML editor.
>
> Any ideas?
>
> Thanks .
> Asra.
>
>
>
> Here my code:
>
> /*****************************************/
> import org.eclipse.swt.SWT;
>
> import org.eclipse.swt.layout.RowLayout;
>
> import org.eclipse.swt.ole.win32.OLE;
>
> import org.eclipse.swt.ole.win32.OleAutomation;
>
> import org.eclipse.swt.ole.win32.OleControlSite;
>
> import org.eclipse.swt.ole.win32.OleFrame;
>
> import org.eclipse.swt.ole.win32.Variant;
>
> import org.eclipse.swt.widgets.Display;
>
> import org.eclipse.swt.widgets.Shell;
>
>
>
> public class ReadOnlyOle {
>
> public static void main (String [] args) {
>
> Display display = new Display ();
>
> Shell shell = new Shell (display);
>
> RowLayout fl = new RowLayout();
>
> shell.setLayout(fl);
>
>
>
> OleFrame oleFrameHtml = new OleFrame(shell,
> SWT.BORDER);
>
> OleControlSite controlSiteHtml = new OleControlSite(oleFrameHtml,
SWT.NONE,
> "DHTMLEdit.DHTMLEdit");
>
> controlSiteHtml.setSize(200, 200);
>
> controlSiteHtml.doVerb(OLE.OLEIVERB_SHOW);
>
> OleAutomation automationHtml = new
> OleAutomation(controlSiteHtml);
>
>
>
>
>
> int[] rgids =
> automationHtml.getIDsOfNames(new String[] {"DocumentHTML"});
>
> Variant returned =
> automationHtml.getProperty(rgids[0]);
>
> Variant[] rgvars = new Variant[1];
>
> rgvars[0] = new Variant("my text HTML");
>
> automationHtml.setProperty(rgids[0],
rgvars);
>
>
>
> ///PUT MY OLECONTROLSITE in READ-ONLY
> ....????
>
>
>
> shell.pack ();
>
> shell.open ();
>
> while (!shell.isDisposed ()) {
>
> if
(!display.readAndDispatch
> ()) display.sleep ();
>
> }
>
> display.dispose ();
>
>
>
> }
>
>
> }
>
> /*****************************************/
>
>
>
>
>
>
Re: How put an OleControlSite in read-only [message #372124 is a reply to message #372107] Wed, 30 July 2003 09:11 Go to previous messageGo to next message
Eclipse User
Originally posted by: asra.choukri.hyperoffice.fr

Thanks you! I find.



"Steve Northover" <steve_northover@ca.ibm.com> a
Re: How put an OleControlSite in read-only [message #1014172 is a reply to message #372086] Mon, 25 February 2013 09:46 Go to previous message
jose andres gomez tovar is currently offline jose andres gomez tovar
Messages: 1
Registered: February 2013
Junior Member
Hi,

I am developing java container and an activeX.

When I do this (java):

oleControlSite = new OleControlSite(oleFrame, SWT.NONE, id ) ;


I read this in visualStudio
Warning: constructing COleException, scode = DISP_E_MEMBERNOTFOUND ($80020003).
Primera excepción en 0x7622c41f en javaw.exe: Excepción de Microsoft C++: COleException en la ubicación de memoria 0x1e2ef420..
Warning: constructing COleException, scode = E_NOTIMPL ($80004001).
Primera excepción en 0x7622c41f en javaw.exe: Excepción de Microsoft C++: COleException en la ubicación de memoria 0x1e2ef420..
Warning: constructing COleException, scode = DISP_E_MEMBERNOTFOUND ($80020003).
Primera excepción en 0x7622c41f en javaw.exe: Excepción de Microsoft C++: COleException en la ubicación de memoria 0x1e2ef410..



What can I do?

Thx in advance
Previous Topic:loading a private key into the embedded browser widget
Next Topic:ActiveX control repaint/clip in JScrollpane
Goto Forum:
  


Current Time: Thu Oct 23 14:41:17 GMT 2014

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

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