예제 #1
0
/******************************************************************************
*                 GetNextDispID
******************************************************************************/
STDMETHODIMP OrxDispID::GetNextDispID(
  /* [in]  */ DWORD pFlags,               // Derived from fdexEnum... defines.
  /* [in]  */ DISPID pDispID,             // Previous DispID returned.
  /* [out] */ DISPID __RPC_FAR *pbDispID)   // Next DispID or -1.
{
    ListItem *Current;
    char      Name[MAX_PATH];


    FPRINTF(CurrentObj_logfile,"OrxDispID::GetNextDispID\n");
    FPRINTF2(CurrentObj_logfile,"DispID %ld   Flags %08x\n ",pDispID,pFlags);
    if (!pbDispID)
    {
        return E_POINTER;
    }
    *pbDispID = -1;
    sprintf(Name,"%d",(int)pDispID);
    Current = (ListItem *)Chain.FindItem(Name);
    if (Current)
    {
        if (pDispID != -1)
        {
            Current = (ListItem *)Chain.FindItem(); // Get the Next DispID.
        }
        // *pbDispID = Current->DispID;
        sscanf(Current->GetName(),"%d",pbDispID);
    }

    FPRINTF2(CurrentObj_logfile,"OrxDispID::GetNextDispID - returning %d\n",*pbDispID);
    return S_OK;
}
예제 #2
0
/******************************************************************************
*
*     FindDispID
*
******************************************************************************/
STDMETHODIMP OrxDispID::FindDispID(OLECHAR *pName, DISPID *pbDispID)
{
    ListItem *CurrItem;
    PDID      CurrDID;
    int       DispID;


    *pbDispID = (DISPID)0;
    CurrItem = Chain.FindItem(0);
    while (CurrItem)
    {
        CurrDID = (PDID)CurrItem->GetContent();
        if (CurrDID->Name != NULL) if (wcsicmp(pName,CurrDID->Name) == 0)
            {
                sscanf(CurrItem->GetName(),"%d",&DispID);
                *pbDispID = (DISPID)DispID;
                FPRINTF2(CurrentObj_logfile,"OrxDisp::FindDispID() Found %S, DispID %d\n",pName,DispID);
                return S_OK;
            }
        CurrItem = Chain.FindItem();
    }
    return DISP_E_UNKNOWNNAME;
}