[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

DUN Rasdial disconnecting issue

Posted on 2004-03-23
8
Medium Priority
?
541 Views
Last Modified: 2007-12-19
Hi experts,

I made an application that uses the RasApi to stablish a Dial-up connection with a local ISP. Everything works like a charm except I can't "cancel" the connection.

While it is dialing and authentificating there is a cancel button in my form, if the user click on it I call rashangup to cancel the connection with a loop to check for the "disconnected" error (6).

This works fine, but the connection never gets disconnected.

I have no clue what the problem might be.

Any ideas?

Thanks,

Esopo.
0
Comment
Question by:Esopo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 10

Expert Comment

by:Kavar
ID: 10658040
give me a sec
0
 
LVL 14

Author Comment

by:Esopo
ID: 10662584
Ok, I'll be waiting... ;)
0
 
LVL 14

Author Comment

by:Esopo
ID: 10671443
Ok, I just realized why my code isn't working. It uses RasEnumConnections to get the pending connection but it won't return any. So I can't call RasHangUp on my connection, or can I ?

Of course that's why RasGetConnectStatus return ERROR_INVALID_HANDLE - "The specified port is not connected".



please check out this Q, it has the code I'm using (or if you'd like I can post it here):

http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20922613.html


Thanks in advanced,

Esopo

BTW I'm also posting another Q here about this RasEnumConnections issue, this is rather urgent.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 10

Accepted Solution

by:
Kavar earned 750 total points
ID: 10676860
Delphi is about my weakest language, (except for english)

Your problem with RasEnumConnections (I think)
is that  a RASCONN structure needs to be created, then set dwsize to 412

var
  RasConn  : TRasConn;
  bsize    : DWORD;
  Count    :  DWORD;
begin
  RasConn.dwSize := 412;

I think you have another one of these open... That I am working on, Like I was indicating on the other thread,
Just use rashangup on the RASCONN handle that you got from the connection
0
 
LVL 14

Author Comment

by:Esopo
ID: 10682707
Using the handle the Rasdial gave me worked. As I said in the other Q I called RasHangUp with the Handle RasDial returned and seems to be working properly.

I am still wondering why isn't RasEnumConnections returning my pending connection?
Does a conection need to be fully stablish to appear there? It seemed to show the dialing connections in Win98 (not 100% sure but I think so).

Anyway, is there a way to get the handle for the pending connections that RasEnumConnections won't give me?
0
 
LVL 10

Expert Comment

by:Kavar
ID: 10683419
I htink rasenum isn't returning because the handle your passing it is not configured right..??

try initializing all values to (0) except for dwsize, set that to 412

unlikely, but it maybe possible to guess at the address of a given connection if you can scan the heap?!?

(REALLY DANGEROUS STUFF)
0
 
LVL 14

Author Comment

by:Esopo
ID: 10982093
Kavar,
What you posted did not really solve my problem, but hey!, it was a very vague question anyway, thanks for trying. At least I got a new thing to look for when playing with RAS.

Venabili,
Sorry to waist your administrative time, I'll try to see to it that my Q's don't go unatended for so long in the future.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question