Click here to Skip to main content
15,885,537 members
Articles / Desktop Programming / Win32

Outlook add-in integrating Skype

Rate me:
Please Sign up or sign in to vote.
4.93/5 (32 votes)
28 May 2015CPOL20 min read 68.7K   2.4K   54  
Outlook add-in integration for Skype IM: Skype events, Outlook Skype ribbon, and more.
#include "Sdk.h"
#include "StringMgr.h"
#include "DbgTrace.h"

#define MAX_TRACE_STRING_LENGTH (1024)

static
VOID
NDAPI
FDbgTrace_SetLevel(
    DbgTrace    *This, 
    int         Level
) {
    This->Level = Level;
    return;
}

static
VOID
NDAPI
FDbgTrace_Track(
    DbgTrace    *This, 
    int         Level,
    LPCWSTR     Msg
) {
    if(Level > This->Level) {
        return;
    }

    OutputDebugStringW(Msg);
    if(IsDebuggerPresent()) {
        OutputDebugStringW(L"\r\n");
    }
}

static
VOID
NDAPIV
FDbgTrace_TrackV(
    DbgTrace    *This, 
    int         Level, 
    LPCWSTR     Msg, 
    ...
) {
    WCHAR MsgV[MAX_TRACE_STRING_LENGTH] = L"";
    va_list ap;

    if(Level > This->Level) {
        return;
    }

    va_start(ap, Msg);
    SzStringFormatV(MsgV, 
                    Msg, 
                    ap
                   );
    va_end(ap);

    This->Track(This, 
                Level, 
                MsgV
               );
}

static
DbgTrace
__DbgTrace = {
    &FDbgTrace_SetLevel, 
    &FDbgTrace_Track, 
    &FDbgTrace_TrackV, 
#ifdef _DEBUG
    TRACE_LEVEL_DEBUG
#else
    TRACE_LEVEL_NONE
#endif
};

DbgTrace*
DbgTrace_GetObject(
    VOID
) {
    return &__DbgTrace;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader BitDefender
Romania Romania
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions