/*============================================================================ * * File Name: ParseDisplayName.cpp * * Class Tribble * * Description: Impletements IParseDisplayName for the Tribble * * Author: Roger Hughes * * Date: 16/10/98 * * *==============================================================================*/ #include "stdafx.h" #include "tribble.h" #include "TribbleClass.h" //IParseDisplayName HRESULT Tribble::ParseDisplayName( /* [unique][in] */ IBindCtx *pbc, /* [in] */ LPOLESTR pszDisplayName, /* [out] */ ULONG *pchEaten, /* [out] */ IMoniker * *ppmkOut) { OutputDebugString("Tribble::IParseDisplayName::ParseDisplayName\n"); // Here we parse all the different item strings // From the string given to use // In this case we only have one // So.. Check that the first char is a '!' and // that the string contains no more ULONG chEaten=0; // first check for a '!' OLECHAR ch=*pszDisplayName++; chEaten++; if ((OLECHAR)'!'!=ch) return MK_E_SYNTAX; //check for another '!' if there is one //we don't support this type of display name for(LPOLESTR psz = pszDisplayName;*psz != (OLECHAR)'\0';psz++,chEaten++) if(*psz == (OLECHAR)'!') break; *pchEaten=chEaten; // Say how much was okay if (*psz == (OLECHAR)'!') return MK_E_SYNTAX; HRESULT hr = CreateItemMoniker(OLESTR("!"), pszDisplayName, ppmkOut); if(FAILED(hr)) { CString strTmp; strTmp.Format("ParseDisplayName Error %lx\n",hr); OutputDebugString(strTmp); } return hr; } /*============================================================================ * End of File: ParseDisplayName.cpp ==============================================================================*/