nikola77
asked on
RAS
How can I detect if there is any connection active ?
And how can I determinate it.........
And how can I determinate it.........
If you need a header for the RAS API (though one of the URLs I gave about _should_ contain it), you cn get it as a part of this component:
http://www.lexology.co.uk/delphi/other/files/tras.zip
Cheers,
Raymond.
http://www.lexology.co.uk/delphi/other/files/tras.zip
Cheers,
Raymond.
ASKER
Undelclared identifier "TRASCONN"
????????
????????
just add "ras" to the uses section of your unit.
raymond has given all you need ...
raymond has given all you need ...
Or if your version of Delphi does not have the ras unit, use the RAS_API32.pas file from tras.zip file mentioned in my comment above.
Let me know when you have it working...
Cheers,
Raymond.
Let me know when you have it working...
Cheers,
Raymond.
ASKER
It's working now,
post me an answer rwilson.
Thanks...........
Cheers, nikola
post me an answer rwilson.
Thanks...........
Cheers, nikola
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks.
function HangUpRAS: Integer;
const
MaxConnections = 16;
var
RAS: array[1..MaxConnections] of TRASCONN;
BuffSize: DWORD;
CONNSWritten: DWORD;
i: Integer;
Ret: DWORD;
begin
Result := 0;
{ retrieve the number of Connections }
RAS[1].dwSize := SizeOf(RAS[1]);
BUFFSize := SizeOf(RAS);
CONNSWritten := 0;
Ret := RasEnumConnections(@RAS, BUFFSize, CONNSWritten);
if (Ret = 0) or (Ret = ERROR_BUFFER_TOO_SMALL) then
for i := 1 to CONNSWritten do
begin
if RashangUp(RAS[i].hrasconn)
end;
end;
Additionally, there are some excellent RAS components and source code available at:
http://www.rtfm.be/fpiette/rasdialuk.htm
and
http://www.bhnet.com.br/~simonet/extras/dialup.zip
Cheers,
Raymond.