// SLNKSymbol.h : Declaration of the CSLNKSymbol #pragma once #include "resource.h" // main symbols #include "SLNKDWF.h" #include "SLNKSymbolDefImpl.h" #include "SLNKSymbolImpl.h" #if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA) #error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms." #endif // CSLNKSymbol class ATL_NO_VTABLE CSLNKSymbol : public CComObjectRootEx, public CComCoClass, public IDispatchImpl { public: CSLNKSymbol() { } //REMOVED DECLARE_REGISTRY_RESOURCEID(IDR_SLNKSYMBOL) BEGIN_COM_MAP(CSLNKSymbol) COM_INTERFACE_ENTRY(ISLNKSymbol) COM_INTERFACE_ENTRY(IDispatch) END_COM_MAP() // ISupportsErrorInfo STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid); DECLARE_PROTECT_FINAL_CONSTRUCT() HRESULT FinalConstruct() { return S_OK; } void FinalRelease() { } // Deze SLNKSymbol wijst naar een CSLNKSymbolImpl in een WhipFile object. We moeten voorkomen // dat deze te snel uit de scope wegvalt. Dat doen we mbv SetParent // Omgekeerd is geen probleem: de WhipFile verwijst niet(!) naar de CSLNKSymbol en heeft er dus // geen last van dat die wegvalt (van zijn SLNKSymbolImpl objecten is hij gewoon eigenaar) void SetParent(IWhipFile *pParent) { HRESULT hr = pParent->QueryInterface(IID_IWhipFile, (void **)&m_parent_iWhipFile); }; void SetImpl(CSLNKSymbolImpl * pSLNKSymbol); private: CSLNKSymbolImpl * m_SLNKSymbol; CComQIPtr m_parent_iWhipFile; // Om scope levend te houden public: STDMETHOD(SetColor)(ULONG rgb, BYTE Alpha); STDMETHOD(SetLineweight)(DOUBLE newVal); STDMETHOD(get_Scale)(DOUBLE* pVal); STDMETHOD(put_Scale)(DOUBLE newVal); STDMETHOD(get_Rotation)(LONG* pVal); STDMETHOD(put_Rotation)(LONG newVal); STDMETHOD(get_Contour)(ISLNKContour** pVal); }; //REMOVED OBJECT_ENTRY_AUTO(__uuidof(SLNKSymbol), CSLNKSymbol)