- ccomthread_src.zip
- LegacyCOMObject1
- Shared
- SimpleCOMObject1
- SimpleCOMObject2
- Test Programs
- VBTest
- VCTests
- DemonstrateDefaultSTA
- VCTest01
- main.cpp
- SimpleCOMObject2.tlh
- SimpleCOMObject2.tli
- VCTest01.dsp
- VCTest01.dsw
- VCTest02
- main.cpp
- SimpleCOMObject2.tlh
- SimpleCOMObject2.tli
- VCTest02.dsp
- VCTest02.dsw
- DemonstrateExeServerSTA
- Client
- VCTest01
- Implementation
- ExeServerImpl
- Interface
- ExeServerInterfaces
- DemonstrateLegacySTA
- VCTest01
- LegacyCOMObject1.tlh
- LegacyCOMObject1.tli
- main.cpp
- VCTest01.dsp
- VCTest01.dsw
- VCTest02
- DemonstrateNoMessageLoop
- VCTest01
- main.cpp
- SimpleCOMObject2.tlh
- SimpleCOMObject2.tli
- VCTest01.dsp
- VCTest01.dsw
- DemonstrateSTA
- VCTest01
- main.cpp
- SimpleCOMObject2.tlh
- SimpleCOMObject2.tli
- VCTest01.dsp
- VCTest01.dsw
|
#ifndef _SIMPLECOMOBJECT1CP_H_
#define _SIMPLECOMOBJECT1CP_H_
template <class T>
class CProxy_ISimpleCOMObject1Events : public IConnectionPointImpl<T, &DIID__ISimpleCOMObject1Events, CComDynamicUnkArray>
{
//Warning this class may be recreated by the wizard.
public:
HRESULT Fire_LengthyFunctionCompleted(LONG lStatus)
{
CComVariant varResult;
T* pT = static_cast<T*>(this);
int nConnectionIndex;
CComVariant* pvars = new CComVariant[1];
int nConnections = m_vec.GetSize();
for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
{
pT->Lock();
CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
pT->Unlock();
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
if (pDispatch != NULL)
{
VariantClear(&varResult);
pvars[0] = lStatus;
DISPPARAMS disp = { pvars, NULL, 1, 0 };
pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL);
}
}
delete[] pvars;
return varResult.scode;
}
};
#endif
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Lim Bio Liong is a Specialist at a leading Software House in Singapore.
Bio has been in software development for over 10 years. He specialises in C/C++ programming and Windows software development.
Bio has also done device-driver development and enjoys low-level programming. Bio has recently picked up C# programming and has been researching in this area.