[dba-SQLServer]C++ Help

James Barash jbarash at bellatlantic.net
Mon Sep 8 13:19:02 CDT 2003


I think you have your logic backwards. Your if statement is testing for
Not IDOK for the true part of the if and IDOK for the else part. You
should be testing for == IDOK

James Barash

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of
Nicholson, Karen
Sent: Monday, September 08, 2003 2:53 PM
To: dba-sqlserver at databaseadvisors.com
Subject: RE: [dba-SQLServer]C++ Help


6 squigleys, no error message, except I dont get my second message box
stated in the else area.

void __fastcall TfrmMainMenu::btnMarkPaidClick(TObject *Sender) { if
(Application->MessageBox("Warning - You are About to Update the Rebate
Pay Field","Warning",MB_OKCANCEL) != IDOK) {StoredProc1->Prepare();
StoredProc1->ExecProc();
}

else {
MessageBox,(NULL, "Records Not Updated", NULL, NULL);
}
}
//----------------------------------------------------------------------
----
-

void __fastcall TfrmMainMenu::btnPayoutRptClick(TObject *Sender) {
       crpe2->ReportFileName =
"c:\\KarenNicholson\\CPlusPlus\\QtrToDateRebatePay.rpt";
       crpe2->PrintReport();
       crpe2->PageZoom (100);
}
//----------------------------------------------------------------------
----
-

-----Original Message-----
From: John Colby [mailto:jcolby at colbyconsulting.com]
Sent: Monday, September 08, 2003 1:41 PM
To: dba-sqlserver at databaseadvisors.com
Subject: RE: [dba-SQLServer]C++ Help


It's been too long but first you have an uneven number of open curly
brackets { vs closed curly brackets.

Second, shouldn't the leading open bracket be behind the if?

John W. Colby
www.colbyconsulting.com

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of
Nicholson, Karen
Sent: Monday, September 08, 2003 2:39 PM
To: Dba-Sqlserver (E-mail)
Subject: [dba-SQLServer]C++ Help


Do we have a group for C++ Help?  I am getting put through the learning
curve ringer, but it is great.  Went from SQL to VB6 now to C++.  Only
problems are those hiccups you get between languages, little things that
add gray hair.

This is my C++ code for an OK, CANCEL button:

{
if (Application->MessageBox("Warning - You are About to Update the
Rebate Pay Field","Warning",MB_OKCANCEL) != IDOK)
{StoredProc1->Prepare();
StoredProc1->ExecProc();
}

else {
MessageBox,(NULL, "Records Not Updated", NULL, NULL);
}
}


I don't think it is working - I don't get the message box I expect if
the user selects cancel.  Any thoughts?
_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com




_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com
_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com



More information about the dba-SQLServer mailing list