Alphabetical Class Index   Compound Members   File List  

Hoops3dStreamCtrlEvents.h
1 #ifndef _HOOPS3DSTREAMCTRLEVENTS_H_
2 #define _HOOPS3DSTREAMCTRLEVENTS_H_
3 
4 
5 template <class T>
6 class CProxy_IHoops3dStreamCtrlEvents : public IConnectionPointImpl<T, &DIID__IHoops3dStreamCtrlEvents, CComDynamicUnkArray>
7 {
8  //Warning this class may be recreated by the wizard.
9 public:
10  HRESULT Fire_OnBeginLoad()
11  {
12  CComVariant varResult;
13  T* pT = static_cast<T*>(this);
14  int nConnectionIndex;
15  int nConnections = m_vec.GetSize();
16 
17  for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
18  {
19  pT->Lock();
20  CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
21  pT->Unlock();
22  IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
23  if (pDispatch != NULL)
24  {
25  VariantClear(&varResult);
26  DISPPARAMS disp = { NULL, NULL, 0, 0 };
27  pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL);
28  }
29  }
30  return varResult.scode;
31 
32  }
33  HRESULT Fire_OnEndLoad()
34  {
35  CComVariant varResult;
36  T* pT = static_cast<T*>(this);
37  int nConnectionIndex;
38  int nConnections = m_vec.GetSize();
39 
40  for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
41  {
42  pT->Lock();
43  CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
44  pT->Unlock();
45  IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
46  if (pDispatch != NULL)
47  {
48  VariantClear(&varResult);
49  DISPPARAMS disp = { NULL, NULL, 0, 0 };
50  pDispatch->Invoke(0x2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL);
51  }
52  }
53  return varResult.scode;
54 
55  }
56  HRESULT Fire_OnSelect(BSTR sel_key)
57  {
58  CComVariant varResult;
59  T* pT = static_cast<T*>(this);
60  int nConnectionIndex;
61  CComVariant* pvars = new CComVariant[1];
62  int nConnections = m_vec.GetSize();
63 
64  for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
65  {
66  pT->Lock();
67  CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
68  pT->Unlock();
69  IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
70  if (pDispatch != NULL)
71  {
72  VariantClear(&varResult);
73  pvars[0] = sel_key;
74  DISPPARAMS disp = { pvars, NULL, 1, 0 };
75  pDispatch->Invoke(0x3, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL);
76  }
77  }
78  delete[] pvars;
79  return varResult.scode;
80 
81  }
82 
83 
84  HRESULT Fire_OnModelStructureParsed()
85  {
86  CComVariant varResult;
87  T* pT = static_cast<T*>(this);
88  int nConnectionIndex;
89  int nConnections = m_vec.GetSize();
90 
91  for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
92  {
93  pT->Lock();
94  CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
95  pT->Unlock();
96  IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
97  if (pDispatch != NULL)
98  {
99  VariantClear(&varResult);
100  DISPPARAMS disp = { NULL, NULL, 0, 0 };
101  pDispatch->Invoke(0x5, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL);
102  }
103  }
104  return varResult.scode;
105 
106  }
107 };
108 #endif