Click here to Skip to main content
16,012,223 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Please help me re-compile the original Quake II source code from "ground-up". Pin
palbano19-Jun-04 18:49
palbano19-Jun-04 18:49 
GeneralRe: Please help me re-compile the original Quake II source code from "ground-up". Pin
Link260019-Jun-04 20:16
Link260019-Jun-04 20:16 
GeneralNorton commander Pin
mark18219-Jun-04 15:49
mark18219-Jun-04 15:49 
GeneralRe: Norton commander Pin
David Crow21-Jun-04 3:15
David Crow21-Jun-04 3:15 
GeneralDebugging wchar_t in VC6.0 Pin
LasVegasGuy19-Jun-04 10:54
LasVegasGuy19-Jun-04 10:54 
GeneralRe: Debugging wchar_t in VC6.0 Pin
Graham Bradshaw19-Jun-04 11:33
Graham Bradshaw19-Jun-04 11:33 
GeneralRe: Debugging wchar_t in VC6.0 Pin
LasVegasGuy19-Jun-04 15:00
LasVegasGuy19-Jun-04 15:00 
GeneralDialup: cancelling InternetAttemptConnect() Pin
PJ Arends19-Jun-04 8:52
professionalPJ Arends19-Jun-04 8:52 
Hey all,

I asked this question two days ago but did not get an answer. Maybe the previous question was too vague or it just got buried too fast. So I will attempt to reword it more clearly with more infomation and hopefully I can get an answer.

I have an app that is designed to automatically fire off emails at a user specified time or time interval. What it does is start a seperate worker thread for each message. The thread will gather the information it needs, build the message, then attempt to send it.

I have a thread manager class that keeps track of all the message threads running. The first thread to get to the point where an internet connection is needed will enter a critical section, and all subsequent threads will have to wait. In the critical section I call InternetGetConnectedState() to see if the computer is already connected to the internet. If it is connected the thread will let the manager class know, and it will clear the critical section and let all the other threads continue. If it is not connected, I call InternetAttemptConnect() to invoke the dialup dialog. At this point all subsequent message threads are stuck waiting for the critical section. If the user presses the cancel button on the dialup dialog, the thread will inform the manager class that there is no connection and the thread will terminate. But the next thread will again repeat the process of attempting to make a connection. So if there are many threads waiting to send, and the user wants to cancel them all, they will have to hit the cancel button once for each thread.

What I want to do is have my main GUI thread popup a modeless dialog with a status panel and a cancel button on it. When the user presses that cancel button, I want to stop all the message threads, and remove the dialup dialog if it is present.

So my question is:
How can I programatically remove or cancel the dialup dialog that is created using the InternetAttemptConnect() function.

Any pointers or suggestions (even telling me if it possible or not) would be appreciated. I am sure I could call TerminateThread() on the message thread that is hung waiting for the dialup dialog, but I do not want to do that as it will make my app unstable.







Sonork 100.11743 Chicken Little

"You're obviously a superstar." - Christian Graus about me - 12 Feb '03

Within you lies the power for good - Use it!
GeneralRe: Dialup: cancelling InternetAttemptConnect() Pin
palbano19-Jun-04 9:51
palbano19-Jun-04 9:51 
GeneralRe: Dialup: cancelling InternetAttemptConnect() Pin
Nish Nishant19-Jun-04 20:31
sitebuilderNish Nishant19-Jun-04 20:31 
GeneralRe: Dialup: cancelling InternetAttemptConnect() Pin
PJ Arends20-Jun-04 9:16
professionalPJ Arends20-Jun-04 9:16 
GeneralRe: Dialup: cancelling InternetAttemptConnect() Pin
Neville Franks20-Jun-04 12:32
Neville Franks20-Jun-04 12:32 
GeneralRe: Dialup: cancelling InternetAttemptConnect() Pin
PJ Arends21-Jun-04 8:31
professionalPJ Arends21-Jun-04 8:31 
GeneralBug tracking Pin
Nevering19-Jun-04 8:41
Nevering19-Jun-04 8:41 
GeneralRe: Bug tracking Pin
PJ Arends19-Jun-04 9:14
professionalPJ Arends19-Jun-04 9:14 
GeneralRe: Bug tracking Pin
Ravi Bhavnani19-Jun-04 17:23
professionalRavi Bhavnani19-Jun-04 17:23 
GeneralRe: Bug tracking Pin
Trollslayer20-Jun-04 1:01
mentorTrollslayer20-Jun-04 1:01 
Questionhow to find dll for active x control cab Pin
19-Jun-04 7:00
suss19-Jun-04 7:00 
AnswerRe: how to find dll for active x control cab Pin
Blake Miller21-Jun-04 3:32
Blake Miller21-Jun-04 3:32 
QuestionHow to use customized static text in Dailog Box Pin
auur19-Jun-04 5:29
auur19-Jun-04 5:29 
AnswerRe: How to use customized static text in Dailog Box Pin
Johan Rosengren19-Jun-04 6:38
Johan Rosengren19-Jun-04 6:38 
GeneralDialog in a DLL Pin
MHillary19-Jun-04 5:16
MHillary19-Jun-04 5:16 
GeneralRe: Dialog in a DLL Pin
Johan Rosengren19-Jun-04 5:20
Johan Rosengren19-Jun-04 5:20 
GeneralRe: Dialog in a DLL Pin
MHillary19-Jun-04 7:11
MHillary19-Jun-04 7:11 
GeneralRe: Dialog in a DLL Pin
Johan Rosengren19-Jun-04 7:19
Johan Rosengren19-Jun-04 7:19 

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.