Alphabetical Class Index   File Members   Compound Members   File List  

Hoops3dStreamCtrlEvents.h

00001 #ifndef _HOOPS3DSTREAMCTRLEVENTS_H_
00002 #define _HOOPS3DSTREAMCTRLEVENTS_H_
00003 
00004 
00005 template <class T>
00006 class CProxy_IHoops3dStreamCtrlEvents : public IConnectionPointImpl<T, &DIID__IHoops3dStreamCtrlEvents, CComDynamicUnkArray>
00007 {
00008     //Warning this class may be recreated by the wizard.
00009 public:
00010     HRESULT Fire_OnBeginLoad()
00011     {
00012         CComVariant varResult;
00013         T* pT = static_cast<T*>(this);
00014         int nConnectionIndex;
00015         int nConnections = m_vec.GetSize();
00016         
00017         for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
00018         {
00019             pT->Lock();
00020             CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
00021             pT->Unlock();
00022             IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
00023             if (pDispatch != NULL)
00024             {
00025                 VariantClear(&varResult);
00026                 DISPPARAMS disp = { NULL, NULL, 0, 0 };
00027                 pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL);
00028             }
00029         }
00030         return varResult.scode;
00031     
00032     }
00033     HRESULT Fire_OnEndLoad()
00034     {
00035         CComVariant varResult;
00036         T* pT = static_cast<T*>(this);
00037         int nConnectionIndex;
00038         int nConnections = m_vec.GetSize();
00039         
00040         for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
00041         {
00042             pT->Lock();
00043             CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
00044             pT->Unlock();
00045             IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
00046             if (pDispatch != NULL)
00047             {
00048                 VariantClear(&varResult);
00049                 DISPPARAMS disp = { NULL, NULL, 0, 0 };
00050                 pDispatch->Invoke(0x2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL);
00051             }
00052         }
00053         return varResult.scode;
00054     
00055     }
00056     HRESULT Fire_OnSelect(BSTR sel_key)
00057     {
00058         CComVariant varResult;
00059         T* pT = static_cast<T*>(this);
00060         int nConnectionIndex;
00061         CComVariant* pvars = new CComVariant[1];
00062         int nConnections = m_vec.GetSize();
00063         
00064         for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
00065         {
00066             pT->Lock();
00067             CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
00068             pT->Unlock();
00069             IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
00070             if (pDispatch != NULL)
00071             {
00072                 VariantClear(&varResult);
00073                 pvars[0] = sel_key;
00074                 DISPPARAMS disp = { pvars, NULL, 1, 0 };
00075                 pDispatch->Invoke(0x3, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL);
00076             }
00077         }
00078         delete[] pvars;
00079         return varResult.scode;
00080     
00081     }
00082 
00083 
00084     HRESULT Fire_OnModelStructureParsed()
00085     {
00086         CComVariant varResult;
00087         T* pT = static_cast<T*>(this);
00088         int nConnectionIndex;
00089         int nConnections = m_vec.GetSize();
00090         
00091         for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
00092         {
00093             pT->Lock();
00094             CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
00095             pT->Unlock();
00096             IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
00097             if (pDispatch != NULL)
00098             {
00099                 VariantClear(&varResult);
00100                 DISPPARAMS disp = { NULL, NULL, 0, 0 };
00101                 pDispatch->Invoke(0x5, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL);
00102             }
00103         }
00104         return varResult.scode;
00105     
00106     }
00107 };
00108 #endif