Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual C++ exit codes

Status
Not open for further replies.

Roger99

MIS
Jul 26, 2002
7
NZ
I am devloping a Visual C++ database application using ODBC.

After I run the program in Debug mode, add a new record, then close the program, the debug window shows that some threads and the program itself have exited with a "code 2".

If I run the program and simply delete a record, this does not occur.

What do the codes this mean; is this serious; and what is likely to be causing it?
 
do not forget about FlushResultSet and/or commit transaction. Also you should close and free any statements before disconnecting from a database.

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
Thanks for the speedy reply, Ion. Your suggestions didn't fix the problem, but they did inspire me check my code, and I have improved the database shutdown as a result.

I have noticed that if I close the app with a toolbar button that simply calls CDialog::OnOk() then there is no problem with the exit codes. (The app uses a modal dialog box.) However, if I use the system menu "x" button, then three of the thread exit codes are "2". I have not touched the default OnSysCommand() handle for this button.

Any idea what's going on?
 
there are some other events what also you can handle. OnClose OnDestroy


Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top