Board index » cppbuilder » Issuing a RAS Hangup

Issuing a RAS Hangup


2005-06-14 05:23:16 AM
cppbuilder41
Is there a way programmatically to do a RAS Hangup. I know I can do it
from the tray icon and the main RAS Dialog, but I need a way to do the
same thing from my program. Anyone have any ideas?
Terry
 
 

Re:Issuing a RAS Hangup

"Terry" < XXXX@XXXXX.COM >wrote in message
Quote
Is there a way programmatically to do a RAS Hangup.
Look at the RasEnumConnections() and RasHangup() functions.
Gambit
 

Re:Issuing a RAS Hangup

Remy Lebeau (TeamB) wrote:
Quote
"Terry" < XXXX@XXXXX.COM >wrote in message
news:42adf943$ XXXX@XXXXX.COM ...


>Is there a way programmatically to do a RAS Hangup.


Look at the RasEnumConnections() and RasHangup() functions.


Gambit


I've found that RasHangUp() doesn't always work 100% and I've had to
manually go and do a hangup from the RAS Dialog. I need to do the same
thing that clicking on "Hangup" does.
 

{smallsort}

Re:Issuing a RAS Hangup

"Terry" < XXXX@XXXXX.COM >wrote in message
Quote
I've found that RasHangUp() doesn't always work 100%
Please elaborate.
Quote
I've had to manually go and do a hangup from the RAS Dialog.
I need to do the same thing that clicking on "Hangup" does.
That is what RasHangup() does.
Gambit
 

Re:Issuing a RAS Hangup

If that is true, then why sometimes does RasHangup() not work and yet if
I go and use the Ras Dialog it always works?
 

Re:Issuing a RAS Hangup

Terry wrote:
Quote
If that is true, then why sometimes does RasHangup() not work and yet if
I go and use the Ras Dialog it always works?
First instinct when that happens to me, is there is something wrong
with my code. You haven't shown your code, so we have no real way of
knowing if it is right or not.
One thing that jumps out at me from this example
msdn.microsoft.com/library/default.asp
is the line
while (dwRetries--)
Which seems to indicate that RasEnumConnections is problematic.
Also, you didn't mention if or what the error code was from RasHangup.
Also, there are a few notes about things that can go wrong here
msdn.microsoft.com/library/default.asp
 

Re:Issuing a RAS Hangup

"Terry" < XXXX@XXXXX.COM >wrote in message
Quote
If that is true, then why sometimes does RasHangup() not work and yet if I
go and use the Ras Dialog it always works?
You could also try InternetHangUp and InternetAutodialHangup instead.
For reason unknown I never used RasHangup, but using InternetHangUp never
caused any problems :)
P.S. Oh, I know:), cause I'm on dial-up, lol