WinDdeQueryString( args, (char*)temp.get(), temp.Length(), CP_WINANSI );
WinDdeQueryString( args, temp.BeginWriting(), temp.Length(), CP_WINANSI );
nsCString nsNativeAppSupportOS2::ParseDDEArg( HSZ args, int index ) {    nsCString result;    DWORD argLen = WinDdeQueryString( args, NULL, NULL, CP_WINANSI );    if ( argLen ) {        nsCString temp;        // Ensure result's buffer is sufficiently big.        temp.SetLength( argLen + 1 );        // Now get the string contents.        WinDdeQueryString( args, (char*)temp.get(), temp.Length(), CP_WINANSI );        // Parse out the given arg.        const char *p = temp.get();        // offset points to the comma preceding the desired arg.        PRInt32 offset = -1;        // Skip commas till we get to the arg we want.        while( index-- ) {            // If this arg is quoted, then go to closing quote.            offset = advanceToEndOfQuotedArg( p, offset, argLen );            // Find next comma.            offset = temp.FindChar( ',', offset );            if ( offset == kNotFound ) {                // No more commas, give up.                return result;            }        }        // The desired argument starts just past the preceding comma,        // which offset points to, and extends until the following        // comma (or the end of the string).        //        // Since the argument might be enclosed in quotes, we need to        // deal with that before searching for the terminating comma.        // We advance offset so it ends up pointing to the start of        // the argument we want.        PRInt32 end = advanceToEndOfQuotedArg( p, offset++, argLen );        // Find next comma (or end of string).        end = temp.FindChar( ',', end );        if ( end == kNotFound ) {            // Arg is the rest of the string.            end = argLen;        }        // Extract result.        result.Assign( p + offset, end - offset );    }    return result;}