//+------------------------------------------------------------------------ // // Microsoft Windows // Copyright (C) Microsoft Corporation, 1993. // // File: bm_Crt.cxx // // Contents: Create apis // // Classes: CCreateApi // // Functions: // // History: // //-------------------------------------------------------------------------- #include #pragma hdrstop #include "hlp_util.hxx" #include "hlp_iocs.hxx" #include "hlp_ias.hxx" #include "hlp_app.hxx" #include "hlp_site.hxx" #include "hlp_doc.hxx" #include "bm_Crt.hxx" TCHAR vlpScratchBuf[256]; //********************************************************************** // // CCreate::Name, SetUp, Run, CleanUp // // Purpose: // // These routines provide the implementation for the Name, Setup, // Run and CleanUp of the class CCreateTest. For details see the doc // for driver what are these routines supposed to do. // // Parameters: // // // Return Value: // // None // // // Comments: // If STRESS is defined don't do anything with timer variable! We are // not interested in time values. // //******************************************************************** TCHAR *CCreateTest::Name () { return TEXT("CreateTest"); } SCODE CCreateTest::Setup (CTestInput *pInput) { CTestBase::Setup(pInput); HRESULT sc; HRESULT hres; #ifdef STRESS //If stress condition loop number of time = STRESSCOUNT m_ulIterations = STRESSCOUNT; #else // get iteration count m_ulIterations = pInput->GetIterations(Name()); #endif #ifndef STRESS // initialize timing arrays INIT_RESULTS(m_ulOleCreateSr32); INIT_RESULTS(m_ulOleCreateOutl); INIT_RESULTS(m_ulOleCreateRenderDrawSr32); INIT_RESULTS(m_ulOleCreateRenderDrawOutl); #endif sc = OleInitialize(NULL); if (FAILED(sc)) { Log (TEXT("Setup - OleInitialize failed."), sc); return sc; } hres = CLSIDFromString(L"Sr32test", &m_clsidSr32); Log (TEXT("CLSIDFromString returned ."), hres); if (hres != NOERROR) return E_FAIL; hres = CLSIDFromString(OutlineClassName, &m_clsidOutl); Log (TEXT("CLSIDFromString returned ."), hres); if (hres != NOERROR) return E_FAIL; //Create Doc and Root storage m_lpDoc = CSimpleDoc::Create(); for (ULONG iIter=0; iIterm_OleClientSite, pSite[iIter]->m_lpObjStorage, (VOID FAR* FAR*)&pSite[iIter]->m_lpOleObject); GetTimerVal(uOleCreatetime[iIter]); LOGRESULTS (TEXT("OleCreate "), hres); if (hres != NOERROR) { goto error; } } //CleanUp before going to Next for (iIter=0; iIterUnloadOleObject(); #ifdef REVIEW //BIG REVIEW I am keeping same ClientSIte and Reusing //delete pSite[iIter]; #endif } return TRUE; error: if (hres != NOERROR) Log (TEXT("Routine CallOleCreate failed with hres = "), hres); return FALSE; }