php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15635 COM Singleton
Submitted: 2002-02-19 18:23 UTC Modified: 2002-03-21 14:22 UTC
From: tlee at calcon dot net Assigned:
Status: No Feedback Package: COM related
PHP Version: 4.1.1 OS: 2000
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2002-02-19 18:23 UTC] tlee at calcon dot net
I noticed that loading a COM object that has been declared as a singleton locks up the browser. I created a simple COM object (header follows), and if I add the SINGLETON macro to the com object, it will hang on instantiation. If anybody has a solution, or a work around, I would greatly appreciate it. It looks as though only simple apartment level COM objects are acceptable. Thank you. Tom Lee



class ATL_NO_VTABLE CIt : 
	public CComObjectRootEx<CComSingleThreadModel>,
	public CComCoClass<CIt, &CLSID_It>,
	public IDispatchImpl<IIt, &IID_IIt, &LIBID_TESTLib>
{
public:
	CIt()
	{
	}

DECLARE_REGISTRY_RESOURCEID(IDR_IT)

// Below macro will destroy the object
DECLARE_CLASSFACTORY_SINGLETON(CIt) // <<<< This it it!!!

DECLARE_PROTECT_FINAL_CONSTRUCT()

BEGIN_COM_MAP(CIt)
	COM_INTERFACE_ENTRY(IIt)
	COM_INTERFACE_ENTRY(IDispatch)
END_COM_MAP()

// IIt
public:
	STDMETHOD(Now)();
protected:

};

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-11 12:53 UTC] phanto@php.net
does this component work in any other environment ?
'locks the browser' is a very wage fordable description of your problem as the browser is in no relation with your com server. so can you look into your servers error log or try to figure out some more details somehow else.
i use lots of singleton objects here and i have no problems with them.

harald
 [2002-03-21 14:22 UTC] phanto@php.net
No feedback was provided for this bug, so it is being suspended.
If you are able to provide the information that was requested,
please do so and change the status of the bug back to "Open".


 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Jul 18 04:01:25 2019 UTC