Hi All,
I'm using wininet.dll to handle connecting to the internet. I use InterNetDial to dial and InterNetHangup to disconnect. If I'm in VFP6 running the program from the source code the application dials up just fine and returns a connection handle that I have to use when it's time to hangup. Works just fine..
But when I build the application exe and run it, InterNetDial just returns a zero for the connection handle. Which is an invalid handle and does not hangup...
Please, does anyone have any ideas on why the InternetDial won't return a handle when my app is compiled and does when uncompiled???
Thanks,
Chet
BTW. I tried the same thing with VB and it works fine..
This is the function I use for Dialing:
*************************************************
LPARAMETER lcDUN,lAutoDial
LOCAL liRC &&, liConn
DECLARE LONG InternetDial in "wininet.dll" ;
LONG hwndParent, ;
STRING lpszConnectoid, ;
LONG dwFlags, ;
LONG @ dwConnection, ;
LONG dwReserved
THIS.cErrorMsg = ""
lcErrMsg = SPACE(256)
liRC = 0
liConn = 0
** Hang up before dialing.
IF This.ConnHandle<>0 THEN
This.IPHangUp(This.ConnHandle)
ENDIF
*!* 0x2 in 3rd parameter for automatc dialing
*!* 0x0 is used for testing purpose
IF lAutoDial THEN
liRC = InternetDial(0 , lcDun , 0x2 , @liConn , 0)
ELSE
liRC = InternetDial(0 , lcDun , 0x0 , @liConn , 0)
ENDIF
This.ConnHandle = liConn
IF LiRC <> 0 THEN
THIS.nError = liRC
THIS.cErrorMsg = THIS.GetErrorMessage(THIS.nError,"Dial-UP Connect"
* RETURN THIS.nError
RETURN THIS.cErrorMsg
ENDIF
RETURN ""
I'm using wininet.dll to handle connecting to the internet. I use InterNetDial to dial and InterNetHangup to disconnect. If I'm in VFP6 running the program from the source code the application dials up just fine and returns a connection handle that I have to use when it's time to hangup. Works just fine..
But when I build the application exe and run it, InterNetDial just returns a zero for the connection handle. Which is an invalid handle and does not hangup...
Please, does anyone have any ideas on why the InternetDial won't return a handle when my app is compiled and does when uncompiled???
Thanks,
Chet
BTW. I tried the same thing with VB and it works fine..
This is the function I use for Dialing:
*************************************************
LPARAMETER lcDUN,lAutoDial
LOCAL liRC &&, liConn
DECLARE LONG InternetDial in "wininet.dll" ;
LONG hwndParent, ;
STRING lpszConnectoid, ;
LONG dwFlags, ;
LONG @ dwConnection, ;
LONG dwReserved
THIS.cErrorMsg = ""
lcErrMsg = SPACE(256)
liRC = 0
liConn = 0
** Hang up before dialing.
IF This.ConnHandle<>0 THEN
This.IPHangUp(This.ConnHandle)
ENDIF
*!* 0x2 in 3rd parameter for automatc dialing
*!* 0x0 is used for testing purpose
IF lAutoDial THEN
liRC = InternetDial(0 , lcDun , 0x2 , @liConn , 0)
ELSE
liRC = InternetDial(0 , lcDun , 0x0 , @liConn , 0)
ENDIF
This.ConnHandle = liConn
IF LiRC <> 0 THEN
THIS.nError = liRC
THIS.cErrorMsg = THIS.GetErrorMessage(THIS.nError,"Dial-UP Connect"
* RETURN THIS.nError
RETURN THIS.cErrorMsg
ENDIF
RETURN ""