?
Solved

DUN Rasdial disconnecting issue

Posted on 2004-03-23
8
Medium Priority
?
535 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Simple Linear Regression
Suggested Courses

752 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