FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Pocket PC Network connection
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Network connection
Posted: Thu Sep 13, 2007 11:48 PM

Is it possible to confirm connection to network withing FWPPC?

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Network connection
Posted: Fri Sep 14, 2007 10:52 AM

Darrell,

If you mean local network, then you may check for a file existence:

if File( "\machine\path\filename" )

For Internet access, you may use:

Function IsInternet()
WSAStartup()
RETURN GetHostByName( "www.microsoft.com" ) != "0.0.0.0"

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Network connection
Posted: Fri Sep 14, 2007 12:17 PM

Thank you Antonio

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Network connection
Posted: Fri Sep 14, 2007 01:56 PM

Antonio,

I got a FWPPC GPF occurred. Fix GPFStack() when using IsInternet function below.

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Network connection
Posted: Fri Sep 14, 2007 02:00 PM

Antonio,

The GPF was caused by the WSAStartup() function. I removed it and I did not get the GPF. Is this function required?

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Network connection
Posted: Fri Sep 14, 2007 02:07 PM

Darrell,

Is IsInternet() working without it ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Network connection
Posted: Fri Sep 14, 2007 02:11 PM

Hi Antonio,

No, it returns IP 0.0.0.0; however the internet is working and my FWPPC application sees host \cargo\data. Should GetHostByName() use 'cargo' or '\cargo'?

Thank you,

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Network connection
Posted: Fri Sep 14, 2007 02:16 PM
"\\" is just for other machines on the LAN.

Please add this code to your PRG:
#pragma BEGINDUMP

#include <hbapi.h>
#include <WinSock2.h>

HB_FUNC( WSASTARTUP )
{
   static WSADATA wsa;

   hb_retni( WSAStartup( 0x202, &wsa ) );
}

#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Network connection
Posted: Fri Sep 14, 2007 02:22 PM

Antonio,

Got the following error when trying to build application.

FiveCEC.lib(WINSOCK.obj) : error LNK2005: HB_FUN_WSASTARTUP already defined in CDM-NET.obj
FiveCEC.lib(WINSOCK.obj) : warning LNK4006: HB_FUN_WSASTARTUP already defined in CDM-NET.obj; second definition ignored
Creating library CDM-NET.lib and object CDM-NET.exp
CDM-NET.exe : fatal error LNK1169: one or more multiply defined symbols found

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Network connection
Posted: Fri Sep 14, 2007 02:44 PM

Darrell,

use this flag for link.exe: /force:MULTIPLE

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Network connection
Posted: Fri Sep 14, 2007 03:43 PM

Antonio,
I am getting a fatal application error.

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Network connection
Posted: Fri Sep 14, 2007 05:30 PM

Darrel,

What FWPPC build are you using ? Please tell me the dates of the libraries, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Network connection
Posted: Fri Sep 14, 2007 05:57 PM

fivece.lib 08/26/2007 @ 23:24
fivecec.lib 08/26/2007 @ 23:20

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Network connection
Posted: Fri Sep 14, 2007 06:15 PM
Darrell,

This Test.prg works fine here with no GPFs. Please try it, thanks:
function Main()

   MsgInfo( IsInternet() )

return nil

Function IsInternet() 
WSAStartup() 
RETURN GetHostByName( "www.microsoft.com" ) != "0.0.0.0"
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Re: Network connection
Posted: Sat May 23, 2009 06:37 PM
Hello Antonio,
this solution is working but if there is no network you get for a very long time a frozen systembefore an error is returned.
Many useres press the reset button because they think the system is gone down.
Maybe there is a better solution?
Thanks in advance
Otto




If you mean local network, then you may check for a file existence:

if File( "\\machine\path\filename" )