FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Pocket PC How to auto open an Internet connection
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
How to auto open an Internet connection
Posted: Thu Oct 08, 2009 10:09 PM

I try with

hInternet = INTERNETOPEN( "http://www.microsoft.com", INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0 )

but I always get back 0 and the connection is not established.

Thanks in advance and best regards,
Otto

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: How to auto open an Internet connection
Posted: Fri Oct 09, 2009 04:31 PM

Otto,

Are you using the emulator or a real device ?

Are you able to open i.e. www.google.com from the internet explorer ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: How to auto open an Internet connection
Posted: Fri Oct 09, 2009 08:29 PM

Hello Antonio,
I am useing a real device and I am able to open internet from the internet explorer.
Thanks in advance
Otto

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: How to auto open an Internet connection
Posted: Fri Oct 09, 2009 10:09 PM
Otto,

Please call MsgInfo( GetLastError() ) to retrieve the specific error message

http://msdn.microsoft.com/en-us/library/aa385096(VS.85).aspx
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: How to auto open an Internet connection
Posted: Sun Oct 11, 2009 10:39 PM
Hello Antonio,

What do I have to link to resolve getLasterror?
Thanks in advance
Otto

ftp1.c
ftp1.obj : error LNK2001: unresolved external symbol HB_FUN_GETLASTERROR
ftp1.exe : fatal error LNK1120: 1 unresolved externa
ls
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: How to auto open an Internet connection
Posted: Sun Oct 11, 2009 11:49 PM
Hi Otto.

Put it to end of main function

Code (fw): Select all Collapse
#pragma BEGINDUMP

#include <windows.h>

HB_FUNC( GETLASTERROR )
{
   hb_retnl( (LONG) GetLastError() );
}

#pragma ENDDUMP
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: How to auto open an Internet connection
Posted: Mon Oct 12, 2009 01:22 PM
Hello Daniel, hello Antonio,
I inserted the following msginfo's.

Code (fw): Select all Collapse
   hInternet = INTERNETOPEN( "http://www.microsoft.com", INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0 )
    MSGINFO( str(GetLastError() ) + "    1" )
  
   IF hINTERNET = 0
      MSGINFO("INTERNETOPEN ERREUR CONNEXION INTERNET envoi sortant")
      RETURN .F.
  ENDIF
 
hConnect = INTERNETCONNECT( hInternet, "ftp.test.info", INTERNET_INVALID_PORT_NUMBER, "user", "pw", INTERNET_SERVICE_FTP, 0, 0 )
  
MSGINFO( str(GetLastError() ) + "    2" )
   IF hConnect = 0
      MSGINFO("INTERNETCONNECT ERREUR Création CONNEXION FTP envoi sortant ... Abandon transmission ")
      RETURN .F.
   ENDIF
MSGINFO( str(GetLastError() ) + "    3" )



If internet is closed I get following error codes:
msginfo 1 |0
msginfo 2 |12007
msginfo 3 | not reached

then I switch to opera9 and open a homepage and switch back to my own program:

msginfo 1 |0
msginfo 2 |183
msginfo 3 | 120
and the file is send.

Best regards,
Otto
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: How to auto open an Internet connection
Posted: Tue Oct 13, 2009 08:24 AM

Only as an information that the setup of the handy is correct.

I tested with the CMHELPER sample (cpp) from Mobile 6 SDK.
This sample opens the connection.
Program Files\Windows Mobile 6 SDK\Samples\PocketPC\CPP\MFC\CMHELPER

Best regards,
Otto

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: How to auto open an Internet connection
Posted: Tue Oct 13, 2009 01:51 PM

I missed the function GprsConnect().
Now all is working.

GprsConnect needs cellcore.lib.

Best regards,
Otto

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: How to auto open an Internet connection
Posted: Thu Oct 15, 2009 05:38 AM

Otto,

Would you mind to post the modified example source code ? thanks :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: How to auto open an Internet connection
Posted: Thu Oct 15, 2009 07:49 AM

Continue the discussion