home *** CD-ROM | disk | FTP | other *** search
/ Popular Software Hundred Flowers Garden / POPSOFT_BHW.iso / SOFTWARE / MPEG / MpegGator / DATA.1 / MTRLOAD.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-06  |  1.5 KB  |  62 lines

  1. //==================================================================
  2. //
  3. //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. //  PURPOSE.
  7. //
  8. //  Copyright (c) 1996 Darim Vision Co., Ltd. ("DARIM")
  9. //==================================================================
  10.  
  11. #include    <windows.h>
  12. #include    <windowsx.h>
  13. #include    <vfw.h>
  14. #include    <memory.h>
  15.  
  16. #include <initguid.h>
  17. #include "mtruid.h"
  18.  
  19. #include "mtrif.h"
  20.  
  21. //==================================
  22. BOOL CreateMpegCapture(IMtrCapture ** mtrcap)
  23. {
  24.     IClassFactory *pDBFactory=NULL;
  25.     HRESULT hRes;
  26.     hRes = CoGetClassObject(CLSID_MtrMe, CLSCTX_SERVER,
  27.         NULL, IID_IClassFactory, (void**) &pDBFactory);
  28.  
  29.     if(FAILED(hRes))
  30.         return FALSE;
  31.  
  32.     hRes = pDBFactory->CreateInstance(NULL, IID_IMtrCapture, (void**)mtrcap);
  33.     if(FAILED(hRes))
  34.         return FALSE;
  35.  
  36.     pDBFactory->Release(); // do not need the factory anymore
  37.  
  38.     return TRUE;
  39. }
  40.  
  41. //==================================
  42. BOOL CreateMpegAccel(IMtrAccel ** mtracc)
  43. {
  44.     IClassFactory *pDBFactory=NULL;
  45.     HRESULT hRes;
  46.  
  47.     hRes = CoGetClassObject(CLSID_MtrMa, CLSCTX_SERVER,
  48.         NULL, IID_IClassFactory, (void**) &pDBFactory);
  49.  
  50.     if(FAILED(hRes))
  51.         return FALSE;
  52.  
  53.     hRes = pDBFactory->CreateInstance(NULL, IID_IMtrAccel, (void**)mtracc);
  54.     if(FAILED(hRes))
  55.         return FALSE;
  56.  
  57.     pDBFactory->Release(); // do not need the factory anymore
  58.  
  59.     return TRUE;
  60. }
  61.  
  62.