Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
nsXPCDispTestMethods.cpp File Reference
#include "stdafx.h"
#include "XPCIDispatchTest.h"
#include "nsXPCDispTestMethods.h"
#include "XPCDispUtilities.h"
#include "nsXPCDispSimple.h"

Go to the source code of this file.

Defines

#define TESTPARAM(val)   Equals(val, #val)
#define ASSIGNPARAM(val)
#define VERIFYSIMPLE(param)
#define ASSIGNSIMPLE(param)

Functions

HRESULT GetProperty (IDispatch *pDisp, const CComBSTR &name, CComVariant &output)
HRESULT PutProperty (IDispatch *pDisp, const CComBSTR &name, const CComVariant &input)
HRESULT VerifynsXPCDispSimple (IDispatch *result)
boolean Equals (BSTR left, const char *str)

Define Documentation

Value:
if (val == 0) \
        return E_POINTER; \
    *val = CComBSTR(#val).Detach()

Definition at line 585 of file nsXPCDispTestMethods.cpp.

#define ASSIGNSIMPLE (   param)
Value:
if (param == 0) \
        return E_POINTER; \
    hResult = nsXPCDispSimple::CreateInstance(param); \
    if (FAILED(hResult)) \
        return hResult;  \

Definition at line 638 of file nsXPCDispTestMethods.cpp.

#define TESTPARAM (   val)    Equals(val, #val)

Definition at line 574 of file nsXPCDispTestMethods.cpp.

#define VERIFYSIMPLE (   param)
Value:
hResult = VerifynsXPCDispSimple(param); \
    if (FAILED(hResult)) \
        return hResult

Definition at line 605 of file nsXPCDispTestMethods.cpp.


Function Documentation

boolean Equals ( BSTR  left,
const char *  str 
) [inline]

Definition at line 570 of file nsXPCDispTestMethods.cpp.

{
    return CComBSTR(left) == str;
}

Here is the caller graph for this function:

HRESULT GetProperty ( IDispatch pDisp,
const CComBSTR &  name,
CComVariant &  output 
) [inline]

Definition at line 181 of file nsXPCDispTestMethods.cpp.

{
    DISPID dispid = GetIDsOfNames(pDisp, name);
    DISPPARAMS dispParams;
    dispParams.cArgs = 0;
    dispParams.cNamedArgs = 0;
    dispParams.rgdispidNamedArgs = 0;
    dispParams.rgvarg = 0;
    return pDisp->Invoke(dispid, IID_NULL, LOCALE_SYSTEM_DEFAULT,DISPATCH_PROPERTYGET, &dispParams, &output, 0, 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

HRESULT PutProperty ( IDispatch pDisp,
const CComBSTR &  name,
const CComVariant &  input 
) [inline]

Definition at line 193 of file nsXPCDispTestMethods.cpp.

{
    DISPPARAMS dispParams;
    DISPID did = DISPID_PROPERTYPUT;
    dispParams.cArgs = 1;
    CComVariant var(input);
    dispParams.rgvarg = &var;
    dispParams.cNamedArgs = 1;
    dispParams.rgdispidNamedArgs = &did;
    CComVariant result;
    DISPID dispID = GetIDsOfNames(pDisp, name);
    return pDisp->Invoke(dispID, IID_NULL, LOCALE_SYSTEM_DEFAULT,
                               DISPATCH_PROPERTYPUT, &dispParams, &result,
                               0, 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 209 of file nsXPCDispTestMethods.cpp.

{
    CComVariant property;
    HRESULT hResult = GetProperty(result, L"Number", property);
    CComVariant test((long)5);
    if (FAILED(hResult))
        return hResult;
    if (property != test)
        return E_FAIL;
    return PutProperty(result, L"Number", 76);
}

Here is the call graph for this function:

Here is the caller graph for this function: