Click here to Skip to main content
15,903,033 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: include file for a COM client (consumer) Pin
George_George27-Sep-08 18:56
George_George27-Sep-08 18:56 
GeneralRe: include file for a COM client (consumer) Pin
Stuart Dootson28-Sep-08 3:44
professionalStuart Dootson28-Sep-08 3:44 
GeneralRe: include file for a COM client (consumer) Pin
George_George28-Sep-08 3:53
George_George28-Sep-08 3:53 
GeneralRe: include file for a COM client (consumer) Pin
Stuart Dootson28-Sep-08 6:40
professionalStuart Dootson28-Sep-08 6:40 
GeneralRe: include file for a COM client (consumer) Pin
George_George30-Sep-08 1:13
George_George30-Sep-08 1:13 
GeneralRe: include file for a COM client (consumer) Pin
Stuart Dootson30-Sep-08 10:10
professionalStuart Dootson30-Sep-08 10:10 
GeneralRe: include file for a COM client (consumer) Pin
George_George30-Sep-08 22:33
George_George30-Sep-08 22:33 
QuestionPass Events from ATL control to javascript Pin
chatko25-Sep-08 17:46
chatko25-Sep-08 17:46 
Hi,

I have a activeX ATL control embeded in an html page. The page also defines some javascript which I'd like to call from my ActiveX object. From reading several articles I realize I could to use connectionpoints to accomplish this. However, I'm stuck with a compile error:

error C2787: '_IWebPluginControlEvents' : no GUID has been associated with this object.

Is there some step i'm missing here? Any help is greatly apperciated!


I have defined a connectionpoint within my IDL file as follows:

In "WebPlugin.idl"

[ 
 uuid(FD84D4F2-4D92-48DE-9A16-0D2F1A43DD6D), 
 helpstring("_IWebPluginControlEvents")
]

dispinterface _IWebPluginControlEvents 
{ 
   properties: 
   methods: 
   [id(1), helpstring("method Finished")] HRESULT Finished();
};


coclass WebPluginControl
{
   [default] interface IWebPluginControl;
   [default, source] dispinterface _IWebPluginControlEvents;
};


I have implemented IProvideClassInfo2Imp and added the COM_ENTRIES as follows:
WebPluginControl.h
// CWebPluginControl
class ATL_NO_VTABLE CWebPluginControl : 
	public CComObjectRootEx<ccomsinglethreadmodel>,
	public IDispatchImpl,
	public IPersistStreamInitImpl<cwebplugincontrol>,
	public IOleControlImpl<cwebplugincontrol>,
	public IOleObjectImpl<cwebplugincontrol>,
	public IOleInPlaceActiveObjectImpl<cwebplugincontrol>,
	public IViewObjectExImpl<cwebplugincontrol>,
	public IOleInPlaceObjectWindowlessImpl<cwebplugincontrol>,
	public ISupportErrorInfo,
	public IPersistStorageImpl<cwebplugincontrol>,
	public ISpecifyPropertyPagesImpl<cwebplugincontrol>,
	public IQuickActivateImpl<cwebplugincontrol>,
	public IDataObjectImpl<cwebplugincontrol>,
	public IProvideClassInfo2Impl<&CLSID_WebPluginControl, &__uuidof(_IWebPluginControlEvents), &LIBID_WebPluginLib>,
	public IObjectSafetyImpl<cwebplugincontrol,>,
	public IConnectionPointContainerImpl<cwebplugincontrol>,
	public IConnectionPointImpl<cwebplugincontrol,&__uuidof(_iwebplugincontrolevents)>,
	public IPropertyNotifySinkCP<cwebplugincontrol>,
	public IPersistPropertyBagImpl<cwebplugincontrol>,
	public CComCoClass<cwebplugincontrol,>,
	public CComControl <cwebplugincontrol>,
	public CProxy_IWebPluginControlEvents<cwebplugincontrol>

BEGIN_COM_MAP(CWebPluginControl)
	COM_INTERFACE_ENTRY(IWebPluginControl)
	COM_INTERFACE_ENTRY(IDispatch)
	COM_INTERFACE_ENTRY(IViewObjectEx)
	COM_INTERFACE_ENTRY(IViewObject2)
	COM_INTERFACE_ENTRY(IViewObject)
	COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless)
	COM_INTERFACE_ENTRY(IOleInPlaceObject)
	COM_INTERFACE_ENTRY2(IOleWindow, IOleInPlaceObjectWindowless)
	COM_INTERFACE_ENTRY(IOleInPlaceActiveObject)
	COM_INTERFACE_ENTRY(IOleControl)
	COM_INTERFACE_ENTRY(IOleObject)
	COM_INTERFACE_ENTRY(IPersistStreamInit)
	COM_INTERFACE_ENTRY2(IPersist, IPersistStreamInit)
	COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer)
	COM_INTERFACE_ENTRY(ISupportErrorInfo)
	COM_INTERFACE_ENTRY(ISpecifyPropertyPages)
	COM_INTERFACE_ENTRY(IQuickActivate)
	COM_INTERFACE_ENTRY(IPersistStorage)
	COM_INTERFACE_ENTRY(IDataObject)
	COM_INTERFACE_ENTRY(IProvideClassInfo)
	COM_INTERFACE_ENTRY(IProvideClassInfo2)
	COM_INTERFACE_ENTRY(IPersistPropertyBag)
	COM_INTERFACE_ENTRY_IID(IID_IObjectSafety, IObjectSafety)
	COM_INTERFACE_ENTRY(IConnectionPointContainer) 
END_COM_MAP()



BEGIN_CONNECTION_POINT_MAP(CWebPluginControl)
	CONNECTION_POINT_ENTRY(__uuidof(_IWebPluginControlEvents))
	CONNECTION_POINT_ENTRY(IID_IPropertyNotifySink)
END_CONNECTION_POINT_MAP()


</cwebplugincontrol></cwebplugincontrol></cwebplugincontrol></cwebplugincontrol></cwebplugincontrol></cwebplugincontrol></cwebplugincontrol></cwebplugincontrol></cwebplugincontrol></cwebplugincontrol></cwebplugincontrol></cwebplugincontrol></cwebplugincontrol></cwebplugincontrol></cwebplugincontrol></ccomsinglethreadmodel>


The proxy class (auto-generated) looks like:

// Wizard-generated connection point proxy class
// WARNING: This file may be regenerated by the wizard

#pragma once

template<class t="">
class CProxy_IWebPluginControlEvents :
	public IConnectionPointImpl<t,>
{
public:
	HRESULT Fire_Finished()
	{
		HRESULT hr = S_OK;
		T * pThis = static_cast<t>(this);
		int cConnections = m_vec.GetSize();

		for (int iConnection = 0; iConnection < cConnections; iConnection++)
		{
			pThis->Lock();
			CComPtr<iunknown> punkConnection = m_vec.GetAt(iConnection);
			pThis->Unlock();

			IDispatch * pConnection = static_cast<idispatch>(punkConnection.p);

			if (pConnection)
			{
				CComVariant varResult;

				DISPPARAMS params = { NULL, NULL, 0, 0 };
				hr = pConnection->Invoke(1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, ¶ms, &varResult, NULL, NULL);
			}
		}
		return hr;
	}
};
</idispatch></iunknown></t></class>


I am using Visual Studio 2003 under windows XP SP2
MIDL compiler version 6.00.0361
Every ATL.dll on my system is versioned > 3 (not sure how to check the exect one visual studio is using)
AnswerRe: Pass Events from ATL control to javascript Pin
chatko29-Sep-08 4:05
chatko29-Sep-08 4:05 
QuestionSample application for connecting to Sql server database in ATL Pin
V K 224-Sep-08 23:23
V K 224-Sep-08 23:23 
AnswerRe: Sample application for connecting to Sql server database in ATL Pin
Stuart Dootson25-Sep-08 0:28
professionalStuart Dootson25-Sep-08 0:28 
QuestionActiveX: still active after close IExplorer Pin
fzhsheng24-Sep-08 21:26
fzhsheng24-Sep-08 21:26 
QuestionIssues when pop up a dialog in IE Pin
Robert Wang198324-Sep-08 3:33
Robert Wang198324-Sep-08 3:33 
QuestionHow can i show the string correctly? Pin
hdj831123-Sep-08 22:44
hdj831123-Sep-08 22:44 
AnswerRe: How can i show the string correctly? Pin
Steve Echols24-Sep-08 18:53
Steve Echols24-Sep-08 18:53 
GeneralRe: How can i show the string correctly? Pin
hdj831124-Sep-08 19:18
hdj831124-Sep-08 19:18 
GeneralRe: How can i show the string correctly? Pin
Steve Echols24-Sep-08 19:23
Steve Echols24-Sep-08 19:23 
GeneralRe: How can i show the string correctly? Pin
hdj831124-Sep-08 22:52
hdj831124-Sep-08 22:52 
QuestionHow do I use CWindowWithReflectorImpl? Pin
Philipp Kursawe22-Sep-08 10:47
Philipp Kursawe22-Sep-08 10:47 
QuestionWhy not to use Smart types in a container? Pin
paresh_joe17-Sep-08 1:55
paresh_joe17-Sep-08 1:55 
QuestionRe: Why not to use Smart types in a container? Pin
paresh_joe17-Sep-08 2:25
paresh_joe17-Sep-08 2:25 
AnswerRe: Why not to use Smart types in a container? Pin
followait17-Sep-08 5:32
followait17-Sep-08 5:32 
GeneralRe: Why not to use Smart types in a container? Pin
paresh_joe17-Sep-08 19:52
paresh_joe17-Sep-08 19:52 
GeneralRe: Why not to use Smart types in a container? Pin
followait17-Sep-08 23:15
followait17-Sep-08 23:15 
Questionvector resize question Pin
followait16-Sep-08 3:53
followait16-Sep-08 3:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.