Click here to Skip to main content
14,662,524 members
Home » Discussions » ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: SQL Server Compact Edition Pin
Richard MacCutchan11-Feb-13 5:58
mveRichard MacCutchan11-Feb-13 5:58 
Questionerror while trying to uplaod the file in current directory using c language Pin
raghvendrapanda30-Jan-13 19:34
Memberraghvendrapanda30-Jan-13 19:34 
AnswerRe: error while trying to uplaod the file in current directory using c language Pin
Richard MacCutchan30-Jan-13 22:03
mveRichard MacCutchan30-Jan-13 22:03 
AnswerRe: error while trying to uplaod the file in current directory using c language Pin
«_Superman_»1-Feb-13 20:34
professional«_Superman_»1-Feb-13 20:34 
QuestionTCP/IP CAsyncSocket and pointers to same Pin
bkelly1324-Jan-13 15:16
Memberbkelly1324-Jan-13 15:16 
Answerclasses don't call upwards Pin
bkelly1326-Jan-13 8:55
Memberbkelly1326-Jan-13 8:55 
QuestionATL and exceptions Pin
imagiro14-Jan-13 8:10
Memberimagiro14-Jan-13 8:10 
AnswerRe: ATL and exceptions Pin
Jonathan Davies18-Jan-13 9:39
MemberJonathan Davies18-Jan-13 9: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 15:24
Memberbkelly1324-Jan-13 15:24 
GeneralRe: ATL and exceptions Pin
Jonathan Davies6-Feb-13 7:23
MemberJonathan Davies6-Feb-13 7:23 
GeneralRe: ATL and exceptions Pin
Albert Holguin11-Feb-13 5:12
professionalAlbert Holguin11-Feb-13 5:12 
Questionunicode and non-unicode Pin
bkelly1314-Jan-13 3:45
Memberbkelly1314-Jan-13 3:45 
AnswerRe: unicode and non-unicode Pin
Richard MacCutchan14-Jan-13 6:24
mveRichard MacCutchan14-Jan-13 6:24 
GeneralRe: unicode and non-unicode Pin
bkelly1314-Jan-13 8:43
Memberbkelly1314-Jan-13 8:43 
GeneralRe: unicode and non-unicode Pin
Richard MacCutchan14-Jan-13 22:13
mveRichard MacCutchan14-Jan-13 22:13 
GeneralRe: unicode and non-unicode Pin
Richard MacCutchan20-Jan-13 22:08
mveRichard MacCutchan20-Jan-13 22:08 
AnswerRe: unicode and non-unicode Pin
xenotron20-Jan-13 1:33
Memberxenotron20-Jan-13 1:33 
GeneralRe: unicode and non-unicode Pin
bkelly1320-Jan-13 8:56
Memberbkelly1320-Jan-13 8:56 
GeneralRe: unicode and non-unicode Pin
xenotron20-Jan-13 10:45
Memberxenotron20-Jan-13 10:45 
AnswerRe: unicode and non-unicode Pin
Albert Holguin11-Feb-13 5:10
professionalAlbert Holguin11-Feb-13 5:10 
Questionsqlconfigdatasource fails on 64 bit from 64 application Pin
MrKBA10-Jan-13 23:02
MemberMrKBA10-Jan-13 23:02 
AnswerRe: sqlconfigdatasource fails on 64 bit from 64 application Pin
Richard MacCutchan10-Jan-13 23:10
mveRichard MacCutchan10-Jan-13 23:10 
GeneralRe: sqlconfigdatasource fails on 64 bit from 64 application Pin
MrKBA10-Jan-13 23:14
MemberMrKBA10-Jan-13 23:14 
GeneralRe: sqlconfigdatasource fails on 64 bit from 64 application Pin
Richard MacCutchan10-Jan-13 23:32
mveRichard MacCutchan10-Jan-13 23:32 
QuestionProblem with embedded ATL component Pin
HungryCPPDev7-Jan-13 1:08
MemberHungryCPPDev7-Jan-13 1: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.