Click here to Skip to main content
15,843,591 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
AnswerRe: DLL Questions Pin
Richard MacCutchan24-Feb-16 22:33
mveRichard MacCutchan24-Feb-16 22:33 
GeneralRe: DLL Questions Pin
bkelly1325-Feb-16 14:07
bkelly1325-Feb-16 14:07 
GeneralRe: DLL Questions Pin
Richard MacCutchan25-Feb-16 23:18
mveRichard MacCutchan25-Feb-16 23:18 
GeneralRe: DLL Questions Pin
Jochen Arndt25-Feb-16 23:37
professionalJochen Arndt25-Feb-16 23:37 
GeneralRe: DLL Questions Pin
Richard MacCutchan26-Feb-16 1:01
mveRichard MacCutchan26-Feb-16 1:01 
QuestionQuestion about Direct3D View Area Pin
Member 112032772-Feb-16 6:24
Member 112032772-Feb-16 6:24 
QuestionFormatMessage for unicode Pin
bkelly1330-Jan-16 16:03
bkelly1330-Jan-16 16:03 
AnswerRe: FormatMessage for unicode Pin
Richard MacCutchan30-Jan-16 22:15
mveRichard MacCutchan30-Jan-16 22:15 
I presume you mean something like:
C++
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:
C++
WCHAR        szMessage[512];
ShowError(nErrorCode, szMessage, _countof(szMessage));
wcout << "Exception: " << szMessage << endl;


modified 31-Jan-16 8:59am.

QuestionMessage Removed Pin
20-Jan-16 22:38
crzoaknn20-Jan-16 22:38 
AnswerMessage Removed Pin
20-Jan-16 22:51
mveGerry Schmitz20-Jan-16 22:51 
QuestionWCHAR argument pointer Resolved Pin
bkelly1314-Jan-16 17:07
bkelly1314-Jan-16 17:07 
AnswerRe: WCHAR argument pointer Pin
Richard Andrew x6414-Jan-16 17:38
professionalRichard Andrew x6414-Jan-16 17:38 
GeneralRe: WCHAR argument pointer Pin
bkelly1315-Jan-16 12:58
bkelly1315-Jan-16 12:58 
QuestionScrolling ATL Dialog with mouse wheel problem. Pin
Member 1213702619-Dec-15 19:11
Member 1213702619-Dec-15 19:11 
AnswerRe: Scrolling ATL Dialog with mouse wheel problem. Pin
Richard MacCutchan19-Dec-15 22:07
mveRichard MacCutchan19-Dec-15 22:07 
QuestionCoCreateInstance(CLSID_SpVoice); fails with Class not registered Pin
ptr_Electron14-Dec-15 1:56
ptr_Electron14-Dec-15 1:56 
AnswerRe: CoCreateInstance(CLSID_SpVoice); fails with Class not registered Pin
Jochen Arndt14-Dec-15 2:39
professionalJochen Arndt14-Dec-15 2:39 
GeneralRe: CoCreateInstance(CLSID_SpVoice); fails with Class not registered Pin
ptr_Electron14-Dec-15 2:52
ptr_Electron14-Dec-15 2:52 
GeneralRe: CoCreateInstance(CLSID_SpVoice); fails with Class not registered Pin
Jochen Arndt14-Dec-15 3:13
professionalJochen Arndt14-Dec-15 3:13 
Questionfind crash location in the code Pin
bkelly1313-Dec-15 16:58
bkelly1313-Dec-15 16:58 
AnswerRe: find crash location in the code Pin
Richard Andrew x6413-Dec-15 17:14
professionalRichard Andrew x6413-Dec-15 17:14 
AnswerRe: find crash location in the code Pin
Richard Andrew x6414-Dec-15 10:37
professionalRichard Andrew x6414-Dec-15 10:37 
Questionhow to determine max TCP/IP send size Pin
bkelly1313-Dec-15 16:51
bkelly1313-Dec-15 16:51 
AnswerRe: how to determine max TCP/IP send size Pin
Richard MacCutchan13-Dec-15 22:11
mveRichard MacCutchan13-Dec-15 22:11 
GeneralRe: how to determine max TCP/IP send size Pin
bkelly1318-Dec-15 16:39
bkelly1318-Dec-15 16:39 

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.