Click here to Skip to main content
12,065,060 members (40,309 online)

ATL / WTL / STL

 
GeneralRe: SQL Server Compact Edition Pin
Richard MacCutchan11-Feb-13 6:58
mvpRichard MacCutchan11-Feb-13 6:58 
Questionerror while trying to uplaod the file in current directory using c language Pin
raghvendrapanda30-Jan-13 20:34
memberraghvendrapanda30-Jan-13 20:34 
AnswerRe: error while trying to uplaod the file in current directory using c language Pin
Richard MacCutchan30-Jan-13 23:03
mvpRichard MacCutchan30-Jan-13 23:03 
AnswerRe: error while trying to uplaod the file in current directory using c language Pin
«_Superman_»1-Feb-13 21:34
member«_Superman_»1-Feb-13 21:34 
QuestionTCP/IP CAsyncSocket and pointers to same Pin
bkelly1324-Jan-13 16:16
memberbkelly1324-Jan-13 16:16 
Answerclasses don't call upwards Pin
bkelly1326-Jan-13 9:55
memberbkelly1326-Jan-13 9:55 
QuestionATL and exceptions Pin
imagiro14-Jan-13 9:10
memberimagiro14-Jan-13 9:10 
AnswerRe: ATL and exceptions Pin
Jonathan Davies18-Jan-13 10:39
memberJonathan Davies18-Jan-13 10:39 
I used a combination. A colleague and I developed an exception object with various constructors that could, for example, be thrown with parameters of: a HRESULT, a string describing what failed, the file name it was thrown in, and the line number of the file it was thrown in.

for example:

HRESULT hr = somefunc();
if(FAILED(hr))
{
    throw _abc_error(hr, L"Somefunc failed", FILE_AND_LINENO);
}
...
catch(_abc_error& err)
{
    MessageBox(err.ErrorMessage(), L"App Name", MB_ICONWARNING | MB_OK);
}

The exception object constructor then took care of writing the error as an event to the System Event log as well as looking up any messages from the HRESULT, or accessing any other error handling mechanism needed.
This resulted in code unclutered with complicated error handling and a standard way of making sure that the log showed not only an error code or message, but a comment on what was being attemted, which .cpp file this was detected in and the line number of the file.
Jonathan

AnswerRe: ATL and exceptions Pin
bkelly1324-Jan-13 16:24
memberbkelly1324-Jan-13 16:24 
GeneralRe: ATL and exceptions Pin
Jonathan Davies6-Feb-13 8:23
memberJonathan Davies6-Feb-13 8:23 
GeneralRe: ATL and exceptions Pin
Albert Holguin11-Feb-13 6:12
memberAlbert Holguin11-Feb-13 6:12 
Questionunicode and non-unicode Pin
bkelly1314-Jan-13 4:45
memberbkelly1314-Jan-13 4:45 
AnswerRe: unicode and non-unicode Pin
Richard MacCutchan14-Jan-13 7:24
mvpRichard MacCutchan14-Jan-13 7:24 
GeneralRe: unicode and non-unicode Pin
bkelly1314-Jan-13 9:43
memberbkelly1314-Jan-13 9:43 
GeneralRe: unicode and non-unicode Pin
Richard MacCutchan14-Jan-13 23:13
mvpRichard MacCutchan14-Jan-13 23:13 
GeneralRe: unicode and non-unicode Pin
Richard MacCutchan20-Jan-13 23:08
mvpRichard MacCutchan20-Jan-13 23:08 
AnswerRe: unicode and non-unicode Pin
pasztorpisti20-Jan-13 2:33
memberpasztorpisti20-Jan-13 2:33 
GeneralRe: unicode and non-unicode Pin
bkelly1320-Jan-13 9:56
memberbkelly1320-Jan-13 9:56 
GeneralRe: unicode and non-unicode Pin
pasztorpisti20-Jan-13 11:45
memberpasztorpisti20-Jan-13 11:45 
AnswerRe: unicode and non-unicode Pin
Albert Holguin11-Feb-13 6:10
memberAlbert Holguin11-Feb-13 6:10 
Questionsqlconfigdatasource fails on 64 bit from 64 application Pin
khaliloenit11-Jan-13 0:02
memberkhaliloenit11-Jan-13 0:02 
AnswerRe: sqlconfigdatasource fails on 64 bit from 64 application Pin
Richard MacCutchan11-Jan-13 0:10
mvpRichard MacCutchan11-Jan-13 0:10 
GeneralRe: sqlconfigdatasource fails on 64 bit from 64 application Pin
khaliloenit11-Jan-13 0:14
memberkhaliloenit11-Jan-13 0:14 
GeneralRe: sqlconfigdatasource fails on 64 bit from 64 application Pin
Richard MacCutchan11-Jan-13 0:32
mvpRichard MacCutchan11-Jan-13 0:32 
QuestionProblem with embedded ATL component Pin
HungryCPPDev7-Jan-13 2:08
memberHungryCPPDev7-Jan-13 2:08 

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.


Advertise | Privacy | Mobile
Web01 | 2.8.160204.4 | Last Updated 2 Feb 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid