Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

xml4comCP.h

Go to the documentation of this file.
00001 /* 00002 * Copyright 1999-2000,2004 The Apache Software Foundation. 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 /* 00018 * $Log: xml4comCP.h,v $ 00019 * Revision 1.2 2004/09/08 13:55:36 peiyongz 00020 * Apache License Version 2.0 00021 * 00022 * Revision 1.1.1.1 2002/02/01 22:21:40 peiyongz 00023 * sane_include 00024 * 00025 * Revision 1.2 2000/03/30 02:00:12 abagchi 00026 * Initial checkin of working code with Copyright Notice 00027 * 00028 */ 00029 00030 #ifndef _XML4COMCP_H_ 00031 #define _XML4COMCP_H_ 00032 00033 template <class T> 00034 class CProxyXMLDOMDocumentEvents : public IConnectionPointImpl<T, &DIID_XMLDOMDocumentEvents, CComDynamicUnkArray> 00035 { 00036 //Warning this class may be recreated by the wizard. 00037 public: 00038 HRESULT Fire_ondataavailable() 00039 { 00040 CComVariant varResult; 00041 T* pT = static_cast<T*>(this); 00042 int nConnectionIndex; 00043 int nConnections = m_vec.GetSize(); 00044 00045 for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++) 00046 { 00047 pT->Lock(); 00048 CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex); 00049 pT->Unlock(); 00050 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p); 00051 if (pDispatch != NULL) 00052 { 00053 VariantClear(&varResult); 00054 DISPPARAMS disp = { NULL, NULL, 0, 0 }; 00055 pDispatch->Invoke(0xc6, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL); 00056 } 00057 } 00058 return varResult.scode; 00059 00060 } 00061 HRESULT Fire_onreadystatechange() 00062 { 00063 CComVariant varResult; 00064 T* pT = static_cast<T*>(this); 00065 int nConnectionIndex; 00066 int nConnections = m_vec.GetSize(); 00067 00068 for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++) 00069 { 00070 pT->Lock(); 00071 CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex); 00072 pT->Unlock(); 00073 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p); 00074 if (pDispatch != NULL) 00075 { 00076 VariantClear(&varResult); 00077 DISPPARAMS disp = { NULL, NULL, 0, 0 }; 00078 pDispatch->Invoke(DISPID_READYSTATECHANGE, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL); 00079 } 00080 } 00081 return varResult.scode; 00082 00083 } 00084 }; 00085 #endif

Generated on Thu Apr 30 02:30:52 2009 for ACS C++ API by doxygen 1.3.8