Click here to Skip to main content
15,886,518 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionPointer/structure usage Pin
fourierman1-Jun-06 16:28
fourierman1-Jun-06 16:28 
QuestionCDialog DoModal doesn't work inside threads? Pin
Dennis Furlaneto1-Jun-06 16:01
Dennis Furlaneto1-Jun-06 16:01 
AnswerRe: CDialog DoModal doesn't work inside threads? Pin
Nibu babu thomas1-Jun-06 17:40
Nibu babu thomas1-Jun-06 17:40 
GeneralRe: CDialog DoModal doesn't work inside threads? Pin
Dennis Furlaneto2-Jun-06 3:35
Dennis Furlaneto2-Jun-06 3:35 
QuestionCan anyone see the problem-newbie [modified] Pin
antonaras1-Jun-06 8:34
antonaras1-Jun-06 8:34 
AnswerRe: Can anyone see the problem-newbie Pin
antonaras1-Jun-06 8:36
antonaras1-Jun-06 8:36 
AnswerRe: Can anyone see the problem-newbie Pin
Chris Losinger1-Jun-06 8:46
professionalChris Losinger1-Jun-06 8:46 
AnswerRe: Can anyone see the problem-newbie [modified] Pin
Zac Howland1-Jun-06 8:59
Zac Howland1-Jun-06 8:59 
Without actually knowing where it is crashing (and not being able to run it myself), here are the most likely places based on the code:

antonaras wrote:
valField1 = pRecordset->Fields->GetItem("Token")->Value;
valField2 = pRecordset->Fields->GetItem("Spam")->Value.intVal;
valField3 = pRecordset->Fields->GetItem("Ham")->Value.intVal;
valField4 = pRecordset->Fields->GetItem("P")->Value.dblVal;
valField5 = pRecordset->Fields->GetItem("app")->Value.intVal;
printf("%d - %s\n",(LPCSTR)valField1,valField2,valField3,valField5);


If GetItem returns NULL for any of those items at any point in time, you will get an access violation. Also, if the types don't match up (that is, if the field is a double and you are checking the int value), you will get strange results that could blow up your stack in a weird place.

Additionally, the printf statement will blow up your stack the way it is written. When you have 2 arguments in the printf string, you should only have 2 variables to match them (you have 2 in the string and 4 trying to match them).

antonaras wrote:
m_pConn->Close();


You didn't close the recordset, so at this point, the connection is being closed. Now, when the Recordset smart pointer goes out of scope, it will attempt to close, but it will no longer have a connection. Try adding a pRecordset->Close(); call prior to the connection's close call.

If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week

Zac

-- modified at 15:21 Thursday 1st June, 2006
AnswerRe: Can anyone see the problem-newbie [modified] Pin
David Crow1-Jun-06 9:19
David Crow1-Jun-06 9:19 
QuestionAnyone know of a good commercial debugger? Pin
leon91-Jun-06 7:01
leon91-Jun-06 7:01 
AnswerRe: Anyone know of a good commercial debugger? Pin
toxcct1-Jun-06 7:25
toxcct1-Jun-06 7:25 
GeneralRe: Anyone know of a good commercial debugger? Pin
BadKarma1-Jun-06 7:47
BadKarma1-Jun-06 7:47 
AnswerRe: Anyone know of a good commercial debugger? Pin
Blake Miller1-Jun-06 8:13
Blake Miller1-Jun-06 8:13 
AnswerRe: Anyone know of a good commercial debugger? Pin
leon91-Jun-06 8:49
leon91-Jun-06 8:49 
AnswerRe: Anyone know of a good commercial debugger? Pin
Zac Howland1-Jun-06 8:51
Zac Howland1-Jun-06 8:51 
AnswerRe: Anyone know of a good commercial debugger? Pin
Kevin McFarlane1-Jun-06 11:40
Kevin McFarlane1-Jun-06 11:40 
GeneralRe: Anyone know of a good commercial debugger? Pin
lastgen1-Jun-06 19:14
lastgen1-Jun-06 19:14 
GeneralRe: Anyone know of a good commercial debugger? Pin
Kevin McFarlane2-Jun-06 0:21
Kevin McFarlane2-Jun-06 0:21 
QuestionActiveX Control Debug version problem Pin
Andrew Hoole1-Jun-06 6:47
Andrew Hoole1-Jun-06 6:47 
AnswerRe: ActiveX Control Debug version problem Pin
Cedric Moonen1-Jun-06 7:21
Cedric Moonen1-Jun-06 7:21 
GeneralRe: ActiveX Control Debug version problem Pin
Andrew Hoole2-Jun-06 6:43
Andrew Hoole2-Jun-06 6:43 
Questionwave sound ... Pin
M_Nuaimi1-Jun-06 5:48
M_Nuaimi1-Jun-06 5:48 
AnswerRe: wave sound ... Pin
Zac Howland1-Jun-06 5:56
Zac Howland1-Jun-06 5:56 
QuestionRe: wave sound ... Pin
David Crow1-Jun-06 7:15
David Crow1-Jun-06 7:15 
QuestionWhy have they done this? Pin
RChin1-Jun-06 5:24
RChin1-Jun-06 5:24 

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.