Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.2 KiB

  1. #include "stdinc.h"
  2. #include "cuimgr.h"
  3. #include "SxApwCreate.h"
  4. static ATL::CComModule Module;
  5. BEGIN_OBJECT_MAP(ObjectMap)
  6. OBJECT_ENTRY(__uuidof(CSxApwUiManager), CSxApwUiManager)
  7. END_OBJECT_MAP()
  8. ATL::CComModule* GetModule() { return &Module; }
  9. ATL::_ATL_OBJMAP_ENTRY* GetObjectMap() { return ObjectMap; }
  10. const CLSID* GetTypeLibraryId() { return NULL; }
  11. HRESULT STDMETHODCALLTYPE
  12. CSxApwUiManager::CreateView(
  13. PCWSTR type, /* progid, clsid, dllpath, whatever.. */
  14. HWND hWnd
  15. )
  16. {
  17. HRESULT hr;
  18. CLSID clsid;
  19. ATL::CComPtr<ISxApwUiView> view;
  20. if (FAILED(hr = CLSIDFromString(const_cast<PWSTR>(type), &clsid)))
  21. goto Exit;
  22. if (FAILED(hr = SxApwCreateObject(clsid, view)))
  23. goto Exit;
  24. if (FAILED(hr = view->SetParentWindow(hWnd)))
  25. goto Exit;
  26. m_views.push_back(view);
  27. Exit:
  28. return hr;
  29. }
  30. HRESULT STDMETHODCALLTYPE
  31. CSxApwUiManager::NextRow(
  32. int nColumns,
  33. const PCWSTR* columns
  34. )
  35. {
  36. /*
  37. just multiplex/broadcast the data across all the views..
  38. */
  39. for (Views_t::const_iterator i = m_views.begin(); i != m_views.end() ; ++i)
  40. {
  41. static_cast<const ATL::CComPtr<ISxApwUiView>&>(*i)->NextRow(nColumns, columns);
  42. }
  43. return S_OK;
  44. }