XLL+ Class Library

COper::operator CString() Example

//{{XLP_SRC(OperCastToStringExample)
    // NOTE - the FunctionWizard will add and remove mapping code here.
    //    DO NOT EDIT what you see in these blocks of generated code!
IMPLEMENT_XLLFN2(OperCastToStringExample, "RP", "OperCastToString"
    "Example", "Arg1", "Example", "Demonstrates casting a COper t"
    "o a CString", "Argument 1\000", "\0", 1)

extern "C" __declspec( dllexport )
LPXLOPER OperCastToStringExample(const COper* lpopArg1)
{
    CXlOper xloResult;
//}}XLP_SRC

    BOOL bOk = TRUE;
    
    // These two lines could have condensed to one:
    // xloResult = (CString)opArg1;
    CString s = *lpopArg1;
    xloResult = s;

    return xloResult.Ret();
}

Uses

COper::operator CString