//+------------------------------------------------------------------------ // // Microsoft Windows // Copyright (C) Microsoft Corporation, 1993. // // File: bm_crtl.cxx // // Contents: CreateLink apis // // Classes: CCreateLinkApi // // 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_crtl.hxx" //********************************************************************** // // CCreateLinkTest::Name, SetUp, Run, CleanUp // // Purpose: // // These routines provide the implementation for the Name, Setup, // Run and CleanUp of the class CCreateLinkTest. 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 *CCreateLinkTest::Name () { return TEXT("CreateLinkTest"); } SCODE CCreateLinkTest::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_ulOleCreateLinkSr32); INIT_RESULTS(m_ulOleCreateLinkOutl); INIT_RESULTS(m_ulOleCreateLinkRenderDrawSr32); INIT_RESULTS(m_ulOleCreateLinkRenderDrawOutl); #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; //CreateLink 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(uOleCreateLinktime[iIter]); LOGRESULTS (TEXT("OleCreateLink "), hres); if (hres != NOERROR) { goto error; } } //CleanUp before going to Next for (iIter=0; iIterUnloadOleObject(); } retVal = TRUE; error: if (hres != NOERROR) Log (TEXT("Routine CallOleCreateLink failed with hres = "), hres); if (pmk) pmk->Release(); return retVal; }