Bug 218533 - [OLE] SWT OleControlSite: OleSetContainedObject overwrites RegisterActiveObject (ACTIVEOBJECT_WEAK) -> Process not terminated
Summary: [OLE] SWT OleControlSite: OleSetContainedObject overwrites RegisterActiveObje...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact: Felipe Heidrich CLA
URL:
Whiteboard: stalebug
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2008-02-11 12:17 EST by StefanS CLA
Modified: 2020-04-22 05:54 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description StefanS CLA 2008-02-11 12:17:45 EST
Build ID: M20060629-1905

Steps To Reproduce:
1. Create a AX-Komponent (an exe-file) with RegisterActiveObject (with ACTIVEOBJECT_WEAK) in Constructor (i hav did in c++)
2. create it with OleControlSite 
3. release the ControlSite -> Prozess ist not ended

More information:
That didn't work (process of AX-Komponent not terminated):

// ------------------------------------------
 public static void main (String[] args) {
    final Display display = new Display ();
    Shell shell = new Shell (display);
    shell.setLayout (new FillLayout ());
    OleControlSite controlSite;
    OleFrame frame;
    try {
      frame = new OleFrame (shell, SWT.NONE);
      controlSite = new OleControlSite (frame, SWT.NONE, "SWTTEST.application");
//      controlSite.doVerb (OLE.OLEIVERB_INPLACEACTIVATE);
    } catch (SWTError e) {
      System.out.println ("Unable to open activeX control");
      return;
    }

    shell.open ();

    // IWebBrowser
//    final OleAutomation swtTest = new OleAutomation (controlSite);

    // Navigate to a web site
    while (!shell.isDisposed ()) {
      if (!display.readAndDispatch ())
        display.sleep ();
    }
    // Remember to release OleAutomation Object
//    swtTest.dispose ();
    controlSite.dispose();
    frame.dispose();
    shell.dispose();
    display.dispose ();

  }
// ------------------------------------------

Escape 
>COM.OleSetContainedObject(objIUnknown.getAddress(), true);
in (SWT)OleClientSite::addObjectReferences() or change it to 
>COM.OleSetContainedObject(objIUnknown.getAddress(), false);
then it works.

Constructor of my Component:

EnableAutomation();
AfxOleLockApp();
//RegisterRunningObject(false);
IDispatch* pIDispatch = GetIDispatch(FALSE);
if (pIDispatch)
{
 DWORD dwCookie = 0;
 HRESULT hR = 0;
 hR = ::RegisterActiveObject(pIDispatch, mClsid,ACTIVEOBJECT_WEAK, &dwCookie);
 mdwRegister = dwCookie;
}
Comment 1 Felipe Heidrich CLA 2009-08-13 11:13:18 EDT
Your bug has been moved to triage, visit http://www.eclipse.org/swt/triage.php for more info.
Comment 2 Leo Ufimtsev CLA 2017-08-03 12:34:30 EDT
This is a one-off bulk update. (The last one in the triage migration).

Moving bugs from swt-triaged@eclipse to platform-swt-inbox@eclipse.org and adding "triaged" keyword as per new triage process:
https://wiki.eclipse.org/SWT/Devel/Triage

See Bug 518478 for details.

Tag for notification/mail filters:
@TriageBulkUpdate
Comment 3 Eclipse Genie CLA 2020-04-22 05:54:21 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.