Click here to Skip to main content
14,580,612 members

ATL / WTL / STL

 
AnswerRe: DLL Questions Pin
Richard MacCutchan24-Feb-16 21:33
mveRichard MacCutchan24-Feb-16 21:33 
GeneralRe: DLL Questions Pin
bkelly1325-Feb-16 13:07
Memberbkelly1325-Feb-16 13:07 
GeneralRe: DLL Questions Pin
Richard MacCutchan25-Feb-16 22:18
mveRichard MacCutchan25-Feb-16 22:18 
GeneralRe: DLL Questions Pin
Jochen Arndt25-Feb-16 22:37
professionalJochen Arndt25-Feb-16 22:37 
GeneralRe: DLL Questions Pin
Richard MacCutchan26-Feb-16 0:01
mveRichard MacCutchan26-Feb-16 0:01 
QuestionQuestion about Direct3D View Area Pin
Member 112032772-Feb-16 5:24
MemberMember 112032772-Feb-16 5:24 
QuestionFormatMessage for unicode Pin
bkelly1330-Jan-16 15:03
Memberbkelly1330-Jan-16 15:03 
AnswerRe: FormatMessage for unicode Pin
Richard MacCutchan30-Jan-16 21:15
mveRichard MacCutchan30-Jan-16 21:15 
I presume you mean something like:
void ShowError(DWORD    dwError,
               PWSTR    pszMessage,
               int      maxMessageSize
               )
{
    if (dwError == 0)
    {
        dwError = GetLastError();
    }
    if (FormatMessage(
        FORMAT_MESSAGE_FROM_SYSTEM |
        FORMAT_MESSAGE_IGNORE_INSERTS |
        FORMAT_MESSAGE_MAX_WIDTH_MASK,                // don't include line breaks
        NULL,                                         // no source message
        dwError,                                      // message identifier
        MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),    // default language
        pszMessage,                                   // address of message buffer
        maxMessageSize,                               // size of user supplied buffer
        NULL                                          // optional parameter list
        ) == 0)
    {
        // unknown error code
        swprintf_s(pszMessage, maxMessageSize, L"Error code: %d (0x%X)", dwError, dwError);
    }
}

Which you call by:
WCHAR        szMessage[512];
ShowError(nErrorCode, szMessage, _countof(szMessage));
wcout << "Exception: " << szMessage << endl;


modified 31-Jan-16 8:59am.

QuestionWCHAR argument pointer Resolved Pin
bkelly1314-Jan-16 16:07
Memberbkelly1314-Jan-16 16:07 
AnswerRe: WCHAR argument pointer Pin
Richard Andrew x6414-Jan-16 16:38
professionalRichard Andrew x6414-Jan-16 16:38 
GeneralRe: WCHAR argument pointer Pin
bkelly1315-Jan-16 11:58
Memberbkelly1315-Jan-16 11:58 
QuestionScrolling ATL Dialog with mouse wheel problem. Pin
Member 1213702619-Dec-15 18:11
MemberMember 1213702619-Dec-15 18:11 
AnswerRe: Scrolling ATL Dialog with mouse wheel problem. Pin
Richard MacCutchan19-Dec-15 21:07
mveRichard MacCutchan19-Dec-15 21:07 
QuestionCoCreateInstance(CLSID_SpVoice); fails with Class not registered Pin
ptr_Electron14-Dec-15 0:56
Memberptr_Electron14-Dec-15 0:56 
AnswerRe: CoCreateInstance(CLSID_SpVoice); fails with Class not registered Pin
Jochen Arndt14-Dec-15 1:39
professionalJochen Arndt14-Dec-15 1:39 
GeneralRe: CoCreateInstance(CLSID_SpVoice); fails with Class not registered Pin
ptr_Electron14-Dec-15 1:52
Memberptr_Electron14-Dec-15 1:52 
GeneralRe: CoCreateInstance(CLSID_SpVoice); fails with Class not registered Pin
Jochen Arndt14-Dec-15 2:13
professionalJochen Arndt14-Dec-15 2:13 
Questionfind crash location in the code Pin
bkelly1313-Dec-15 15:58
Memberbkelly1313-Dec-15 15:58 
AnswerRe: find crash location in the code Pin
Richard Andrew x6413-Dec-15 16:14
professionalRichard Andrew x6413-Dec-15 16:14 
AnswerRe: find crash location in the code Pin
Richard Andrew x6414-Dec-15 9:37
professionalRichard Andrew x6414-Dec-15 9:37 
Questionhow to determine max TCP/IP send size Pin
bkelly1313-Dec-15 15:51
Memberbkelly1313-Dec-15 15:51 
AnswerRe: how to determine max TCP/IP send size Pin
Richard MacCutchan13-Dec-15 21:11
mveRichard MacCutchan13-Dec-15 21:11 
GeneralRe: how to determine max TCP/IP send size Pin
bkelly1318-Dec-15 15:39
Memberbkelly1318-Dec-15 15:39 
GeneralRe: how to determine max TCP/IP send size Pin
Richard MacCutchan18-Dec-15 21:47
mveRichard MacCutchan18-Dec-15 21:47 
AnswerRe: how to determine max TCP/IP send size Pin
Albert Holguin17-Feb-16 9:41
professionalAlbert Holguin17-Feb-16 9:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.