` Printed Icetips Article

Icetips Article



Par2: Getting an application to auto-dial
2003-10-24 -- Simon Burrows
 
There are two API's which you can use for this.

The first InternetGetConnectedState(iStatus,0) returns true if there already
is an Internet connection available
The second InternetAttemptConnect(0) will popup a dialup connection dialog
if there is no connection already.  Bear in mind that this is based on your
IE dialup settings, so if they are set to never dial, then this popup will
be ignored.

iConnection = InternetGetConnectedState(iStatus,0)            !Find current
connection
iDialUp  = InternetAttemptConnect(0)
!display the dialup dialog

(iStatus contains a ULong with represents the type of connection for this
computer (i.e. dialup, Proxy, LAN etc).  iStatus does not however represent
any current connection, just the method.

These functions are defined in the wininet.lib file which is in your
c55/libsrc directory

So in your global embeds in the 'Inside Global Map' embed put:-

  Module('Wininet.lib')
    InternetAttemptConnect(ULong),Long,
pascal,raw,name('InternetAttemptConnect')

InternetGetConnectedState(*Ulong,Ulong),Long,Pascal,raw,name('InternetGetCon
nectedState')
  end

And REMEBER to include the wininet.lib file in your project, otherwise you
will get a compile error.



Printed May 3, 2024, 6:21 pm
This article has been viewed/printed 35121 times.