Click here to Skip to main content
15,900,378 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to convert word(or)excel document to pdf Pin
soo preety6-Nov-09 22:08
soo preety6-Nov-09 22:08 
AnswerRe: how to convert word(or)excel document to pdf Pin
Richard MacCutchan6-Nov-09 22:33
mveRichard MacCutchan6-Nov-09 22:33 
AnswerRe: how to convert word(or)excel document to pdf Pin
Paresh Chitte6-Nov-09 23:15
Paresh Chitte6-Nov-09 23:15 
QuestionKey press missing Pin
Deepak.Prahlad6-Nov-09 20:13
Deepak.Prahlad6-Nov-09 20:13 
AnswerRe: Key press missing Pin
includeh106-Nov-09 23:33
includeh106-Nov-09 23:33 
GeneralRe: Key press missing Pin
Deepak.Prahlad7-Nov-09 17:56
Deepak.Prahlad7-Nov-09 17:56 
QuestionHelp Needed Controlling other application using VC++ Pin
Ram Murali6-Nov-09 19:55
Ram Murali6-Nov-09 19:55 
AnswerRe: Help Needed Controlling other application using VC++ Pin
Richard MacCutchan6-Nov-09 22:36
mveRichard MacCutchan6-Nov-09 22:36 
GeneralRe: Help Needed Controlling other application using VC++ Pin
Ram Murali6-Nov-09 22:47
Ram Murali6-Nov-09 22:47 
GeneralRe: Help Needed Controlling other application using VC++ Pin
Richard MacCutchan6-Nov-09 22:50
mveRichard MacCutchan6-Nov-09 22:50 
GeneralRe: Help Needed Controlling other application using VC++ Pin
Ram Murali6-Nov-09 22:57
Ram Murali6-Nov-09 22:57 
GeneralRe: Help Needed Controlling other application using VC++ Pin
David Crow7-Nov-09 10:16
David Crow7-Nov-09 10:16 
AnswerRe: Help Needed Controlling other application using VC++ Pin
Kushagra Tiwari7-Nov-09 0:12
Kushagra Tiwari7-Nov-09 0:12 
QuestionArray help in cpp Pin
Pierre-Andre Malborugh6-Nov-09 14:36
Pierre-Andre Malborugh6-Nov-09 14:36 
AnswerRe: Array help in cpp Pin
Hans Dietrich6-Nov-09 15:08
mentorHans Dietrich6-Nov-09 15:08 
QuestionNeed some Help ON DLL Thank You Pin
VB_Crazy6-Nov-09 12:38
VB_Crazy6-Nov-09 12:38 
QuestionMFC Application Scroll bar issue on PDF Viewer Pin
kasi146-Nov-09 11:31
kasi146-Nov-09 11:31 
AnswerRe: MFC Application Scroll bar issue on PDF Viewer Pin
Garth J Lancaster6-Nov-09 13:57
professionalGarth J Lancaster6-Nov-09 13:57 
GeneralRe: MFC Application Scroll bar issue on PDF Viewer Pin
kasi149-Nov-09 6:08
kasi149-Nov-09 6:08 
QuestionBreakpoints in Wincore.cpp Pin
Member 36807856-Nov-09 5:50
Member 36807856-Nov-09 5:50 
AnswerRe: Breakpoints in Wincore.cpp Pin
Rajesh R Subramanian6-Nov-09 6:26
professionalRajesh R Subramanian6-Nov-09 6:26 
AnswerRe: Breakpoints in Wincore.cpp Pin
sashoalm6-Nov-09 6:32
sashoalm6-Nov-09 6:32 
AnswerRe: Breakpoints in Wincore.cpp Pin
Randor 6-Nov-09 7:15
professional Randor 6-Nov-09 7:15 
QuestionCDatabase::OpenEx failure kills UI thread Pin
Gary Wheeler6-Nov-09 5:13
Gary Wheeler6-Nov-09 5:13 
I've recently moved my data base code into a worker thread, which works just fine unless the data base open fails. I currently have the thread wait 15 seconds, and then try the open again. This process repeats until the data base opens successfully or the application exits. The problem I'm having is that, when this logic is occurring, my UI thread will fail with an access violation some time later. It appears that having the CDatabase::OpenEx() call fail causes some sort of corruption to either the UI thread's MFC state or its stack, which is then exposed as the UI is navigated.

I'm using SQL Server 2005 Express, Service Pack 2.

I've tried the following to resolve this:

1. If I comment out the data base operations (OpenEx() ... Close()), the UI does not crash.

2. If I comment out the data base operations like in #1, and replace them with a AfxThrowDBException(...), the UI does not crash.

3. One suspect was the CDatabase::OpenEx() implementation, which does some hinky looking things trying to find a window handle. I overrode it and passed a NULL window handle to the ::SQLDriverConnect() call that does the real work of connecting to the data base. The UI still crashes.

From these results I can only conclude that there is some kind of problem here using CDatabase/CRecordset in a worker thread that isn't documented. I've searched on MSDN and Google'd several times, and only found claims of issues with specific ODBC drivers.

Anyone have any suggestions, or ideas that I've missed?

Software Zen: delete this;

QuestionRe: CDatabase::OpenEx failure kills UI thread Pin
Randor 6-Nov-09 6:25
professional Randor 6-Nov-09 6:25 

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.