Click here to Skip to main content
16,010,394 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to get local path from a shared folder name? Pin
Alberto Giannetto15-Aug-02 4:27
Alberto Giannetto15-Aug-02 4:27 
GeneralCompiling Visual C++ .NET projects from command line Pin
James Pullicino15-Aug-02 4:09
sussJames Pullicino15-Aug-02 4:09 
GeneralRe: Compiling Visual C++ .NET projects from command line Pin
Stuart Dootson15-Aug-02 11:05
professionalStuart Dootson15-Aug-02 11:05 
GeneralLogon script and dial up Pin
Alberto Giannetto15-Aug-02 3:45
Alberto Giannetto15-Aug-02 3:45 
Generalstaement executes once then next time around -exception Pin
ns15-Aug-02 3:33
ns15-Aug-02 3:33 
GeneralRe: staement executes once then next time around -exception Pin
Ranjan Banerji15-Aug-02 3:37
Ranjan Banerji15-Aug-02 3:37 
GeneralRe: staement executes once then next time around -exception Pin
ns15-Aug-02 3:46
ns15-Aug-02 3:46 
GeneralRe: staement executes ...error checking doesnt report anything: Pin
ns15-Aug-02 3:41
ns15-Aug-02 3:41 
None of the messsageboxes fire, the program execution merrily skips past the called function and goes on!

THe error checking in place is:

void PrintProviderError(_ConnectionPtr pConnection)

{

//Define Other Variables

HRESULT hr = S_OK;

_bstr_t strError;

ErrorPtr pErr = NULL;


try

{

// Enumerate Errors collection and display

// properties of each Error object.

long nCount = pConnection->Errors->Count;


// Collection ranges from 0 to nCount - 1.

for(long i = 0; i < nCount; i++)

{

pErr = pConnection->Errors->GetItem(i);

CString temp;

temp.Format("Error #%d\n", pErr->Number);

AfxMessageBox(temp);

temp.Format(" %s\n",(LPCSTR)pErr->Description);

AfxMessageBox(temp);

temp.Format(" (Source: %s)\n",(LPCSTR)pErr->Source);

AfxMessageBox(temp);

temp.Format(" (SQL State: %s)\n",(LPCSTR)pErr->SQLState);

AfxMessageBox(temp);

temp.Format(" (NativeError: %d)\n",(LPCSTR)pErr->NativeError);

AfxMessageBox(temp);



if ((LPCSTR)pErr->GetHelpFile() == NULL)

{

AfxMessageBox("\tNo Help file available\n");

}

else

{
CString temp1;
temp1.Format("\t(HelpFile: %s\n)" ,pErr->HelpFile);

AfxMessageBox(temp1);

temp1.Format("\t(HelpContext: %s\n)" , pErr->HelpContext);

AfxMessageBox(temp1);

}

}

}

catch(_com_error &e)

{

// Notify the user of errors if any.

PrintComError(e);

}

}


///////////////////////////////////////////////////////////

// //

// PrintComError Function //

// //

///////////////////////////////////////////////////////////


void PrintComError(_com_error &e)

{

// Notify the user of errors if any.

_bstr_t bstrSource(e.Source());

_bstr_t bstrDescription(e.Description());


// Print Com errors.


AfxMessageBox("Error\n");

CString temp;

temp.Format("\tCode = %08lx\n", e.Error());

AfxMessageBox(temp);

temp.Format("\tCode meaning = %s", e.ErrorMessage());

AfxMessageBox(temp);

temp.Format("\tSource = %s\n", (LPCSTR) bstrSource);

AfxMessageBox(temp);

temp.Format("\tDescription = %s\n", (LPCSTR) bstrDescription);

AfxMessageBox(temp);

}

QuestionHow to set quota limits of disk in VC++ Pin
Tida15-Aug-02 3:00
Tida15-Aug-02 3:00 
GeneralRegistry script problem Pin
pankajdaga15-Aug-02 2:53
pankajdaga15-Aug-02 2:53 
GeneralRe: Registry script problem Pin
Jon Hulatt16-Aug-02 2:32
Jon Hulatt16-Aug-02 2:32 
Questiondynamic button on CFormView Child ?? Pin
AlinRO15-Aug-02 2:30
AlinRO15-Aug-02 2:30 
AnswerRe: dynamic button on CFormView Child ?? Pin
Roger Allen15-Aug-02 3:56
Roger Allen15-Aug-02 3:56 
Questiondynamic button on CFormView ??? Pin
AlinRO15-Aug-02 2:29
AlinRO15-Aug-02 2:29 
AnswerRe: dynamic button on CFormView ??? Pin
Alberto Giannetto15-Aug-02 3:48
Alberto Giannetto15-Aug-02 3:48 
GeneralRegistry problem... Pin
code dope15-Aug-02 1:08
code dope15-Aug-02 1:08 
GeneralRe: Registry problem... Pin
Anders Molin15-Aug-02 2:08
professionalAnders Molin15-Aug-02 2:08 
GeneralRe: Registry problem... Pin
567890123415-Aug-02 2:34
567890123415-Aug-02 2:34 
GeneralRe: Registry problem... Pin
code dope15-Aug-02 2:54
code dope15-Aug-02 2:54 
GeneralRe: Registry problem... Pin
567890123415-Aug-02 3:20
567890123415-Aug-02 3:20 
GeneralRe: Registry problem... Pin
code dope15-Aug-02 2:50
code dope15-Aug-02 2:50 
GeneralRe: Registry problem... Pin
Anders Molin15-Aug-02 4:23
professionalAnders Molin15-Aug-02 4:23 
GeneralRe: Registry problem... Pin
Ryan B.15-Aug-02 9:00
Ryan B.15-Aug-02 9:00 
GeneralCreate a button on a CReBar Error !! Pin
code_cold15-Aug-02 0:37
code_cold15-Aug-02 0:37 
GeneralRe: Create a button on a CReBar Error !! Pin
Tomasz Sowinski15-Aug-02 1:01
Tomasz Sowinski15-Aug-02 1:01 

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.