CPI_Stream.c
上传用户:tuheem
上传日期:2007-05-01
资源大小:21889k
文件大小:1k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. #include "stdafx.h"
  2. #include "globals.h"
  3. #include "CPI_Stream.h"
  4. CPs_InStream* CP_CreateInStream_LocalFile(const char* pcFlexiURL, HWND hWndOwner);
  5. CPs_InStream* CP_CreateInStream_Internet(const char* pcFlexiURL, HWND hWndOwner);
  6. //
  7. CPs_InStream* CP_CreateInStream(const char* pcFlexiURL, HWND hWndOwner)
  8. {
  9.     CPs_InStream* pNewStream = NULL;
  10.     int iURLLen = strlen(pcFlexiURL);
  11.     if(iURLLen > 5)
  12.     {
  13.         char cHeader[6];
  14.         memcpy(cHeader, pcFlexiURL, 5);
  15.         cHeader[5] = '';
  16. if(stricmp(cHeader, "http:") == 0)
  17.         {
  18.             pNewStream = CP_CreateInStream_Internet(pcFlexiURL, hWndOwner);
  19.             if(pNewStream)
  20.                 return pNewStream;
  21.         }
  22.     }
  23.     pNewStream = CP_CreateInStream_LocalFile(pcFlexiURL, hWndOwner);
  24.     if(pNewStream)
  25.         return pNewStream;
  26.     return NULL;
  27. }