<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Checking internet connection from fortran in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/m-p/813100#M43897</link>
    <description>If you right-click on the executable and select 'View Dependencies', Dependency Walker should open (always supposing you have it installed) and it will show you that WININET.DLL is indeed required.&lt;BR /&gt;&lt;BR /&gt;I have no idea how my VS 2005 knows where the export library WININET.LIB associated with the DLL is located on my system and therefore have no idea how VS automatically finds it when it is listed as an Additional dependency. Perhaps Steve can oblige?. On my system, I have found that WININET.LIB is located at a couple of places, both in a PlatformSDK /Lib/ folder.</description>
    <pubDate>Fri, 03 Jun 2011 12:40:03 GMT</pubDate>
    <dc:creator>anthonyrichards</dc:creator>
    <dc:date>2011-06-03T12:40:03Z</dc:date>
    <item>
      <title>Checking internet connection from fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/m-p/813094#M43891</link>
      <description>Can anyone point me to a reliable method of getting the internet status of the machine that my application is running on. I've tried such MS functions as InternetGetConnectedStatus but it doesn't appear to exist anymore.&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks, ACAR.&lt;/DIV&gt;</description>
      <pubDate>Thu, 02 Jun 2011 15:47:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/m-p/813094#M43891</guid>
      <dc:creator>acar</dc:creator>
      <dc:date>2011-06-02T15:47:19Z</dc:date>
    </item>
    <item>
      <title>Checking internet connection from fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/m-p/813095#M43892</link>
      <description>The function you want is in WININET.DLL (in c:\windows\system32\). The following code works for me as a console project when compiled and linked using multithreaded dll libraries:&lt;BR /&gt;(p.s. You may need to add WININET.LIB to the link library list for the project) &lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;	program Testinternetconnection&lt;BR /&gt;use dfwin&lt;BR /&gt;use dflib&lt;/P&gt;&lt;P&gt;	implicit none&lt;BR /&gt;interface&lt;BR /&gt;Integer function InternetGetConnectedState(result, dummy)&lt;BR /&gt;!DEC$ ATTRIBUTES C, ALIAS :'_InternetGetConnectedState@8'::InternetGetConnectedState&lt;BR /&gt;!DEC$ ATTRIBUTES REFERENCE:: RESULT&lt;BR /&gt;!DEC$ ATTRIBUTES VALUE:: DUMMY&lt;BR /&gt;integer dummy&lt;BR /&gt;integer result&lt;BR /&gt;end function&lt;BR /&gt;end interface &lt;/P&gt;&lt;P&gt;	INTEGER, PARAMETER :: INTERNET_CONNECTION_CONFIGURED	= Z'40'&lt;BR /&gt;INTEGER, PARAMETER :: INTERNET_CONNECTION_LAN			= Z'2'&lt;BR /&gt;INTEGER, PARAMETER :: INTERNET_CONNECTION_MODEM			= Z'1'&lt;BR /&gt;INTEGER, PARAMETER :: INTERNET_CONNECTION_OFFLINE		= Z'20'&lt;BR /&gt;INTEGER, PARAMETER :: INTERNET_CONNECTION_PROXY			= Z'4'&lt;BR /&gt;INTEGER, PARAMETER :: INTERNET_RAS_INSTALLED			= Z'10' &lt;/P&gt;&lt;P&gt;	integer iret, lret&lt;BR /&gt;character(3) chiret&lt;BR /&gt;integer result &lt;/P&gt;&lt;P&gt;	iret=InternetGetConnectedState(result, 0)&lt;BR /&gt;!&lt;BR /&gt;write(chiret,'(i3)') iret&lt;BR /&gt;lret=MessageBox(0,'iret = '//chiret//char(0),'Internetconnection status'c,MB_OK) &lt;/P&gt;&lt;P&gt;	If ((Result.AND.INTERNET_CONNECTION_CONFIGURED) .EQ. INTERNET_CONNECTION_CONFIGURED) Then&lt;BR /&gt;lret=MessageBox(0,"Local system has a valid connection to the Internet,/r but it may or may not be currently connected."c, &amp;amp; 'Internet Connection Status'c, mb_OK)&lt;BR /&gt;endif&lt;BR /&gt;If ((Result.AND.INTERNET_CONNECTION_LAN) .EQ. INTERNET_CONNECTION_LAN) Then&lt;BR /&gt;lret=MessageBox(0,"Local system uses a local area network to connect to the Internet."c, &amp;amp;&lt;BR /&gt;'Internet Connection Status'c, mb_OK)&lt;BR /&gt;endif&lt;BR /&gt;If ((Result.AND.INTERNET_CONNECTION_MODEM) .EQ. INTERNET_CONNECTION_MODEM) Then&lt;BR /&gt;lret=MessageBox(0,"Local system uses a modem to connect to the Internet."c, &amp;amp;&lt;BR /&gt;'Internet Connection Status'c, mb_OK)&lt;BR /&gt;endif&lt;BR /&gt;If ((Result.AND.INTERNET_CONNECTION_OFFLINE) .EQ. INTERNET_CONNECTION_OFFLINE) Then&lt;BR /&gt;lret=MessageBox(0,"Local system is in offline mode."c, &amp;amp;&lt;BR /&gt;'Internet Connection Status'c, mb_OK)&lt;BR /&gt;endif&lt;BR /&gt;If ((Result.AND.INTERNET_CONNECTION_PROXY) .EQ. INTERNET_CONNECTION_PROXY) Then&lt;BR /&gt;lret=MessageBox(0,"Local system uses a proxy server to connect to the Internet."c, &amp;amp;&lt;BR /&gt;'Internet Connection Status'c, mb_OK)&lt;BR /&gt;endif&lt;BR /&gt;If ((Result.AND.INTERNET_RAS_INSTALLED) .EQ. INTERNET_RAS_INSTALLED) Then&lt;BR /&gt;lret=MessageBox(0,"Local system has RAS installed."c, &amp;amp;&lt;BR /&gt;'Internet Connection Status'c, mb_OK)&lt;BR /&gt;endif &lt;/P&gt;&lt;P&gt;	end program Testinternetconnection&lt;/P&gt;&lt;P&gt;(P.S. Later bug-tracing shows that the above has the wrong calling convention: Please replace &lt;BR /&gt;
!DEC$ ATTRIBUTES C, ALIAS :'_InternetGetConnectedState@8'::InternetGetConnectedState&lt;BR /&gt;
with&lt;BR /&gt;
!DEC$ ATTRIBUTES STDCALL, ALIAS :'_InternetGetConnectedState@8'::InternetGetConnectedState&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2011 18:33:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/m-p/813095#M43892</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2011-06-02T18:33:13Z</dc:date>
    </item>
    <item>
      <title>Checking internet connection from fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/m-p/813096#M43893</link>
      <description>Most grateful for your response Anthony and apologies if I'm being a bit dim but I still can't get the call to InternetGetConnectedState to work - I copied your code verbatim and I get a linker error LNK2019: unresolved external on the function _InternetGetConnectedState@8. WININET.dll exists on my system in the location you suggested so I wonder what the issue is here? I note that if I do a search for this function in my version of VS2008 is also does not find it. Do I somehow need to register the dll in my application (or your console app)? Thanks, ACAR.</description>
      <pubDate>Fri, 03 Jun 2011 09:47:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/m-p/813096#M43893</guid>
      <dc:creator>acar</dc:creator>
      <dc:date>2011-06-03T09:47:01Z</dc:date>
    </item>
    <item>
      <title>Checking internet connection from fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/m-p/813097#M43894</link>
      <description>Did you also add the WINNET.LIB (note the extension!) to the libraries in the link step? as Anthony suggested (in his PS)&lt;BR /&gt;&lt;BR /&gt;Les</description>
      <pubDate>Fri, 03 Jun 2011 10:09:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/m-p/813097#M43894</guid>
      <dc:creator>Les_Neilson</dc:creator>
      <dc:date>2011-06-03T10:09:10Z</dc:date>
    </item>
    <item>
      <title>Checking internet connection from fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/m-p/813098#M43895</link>
      <description>Les is correct. My original posted project was created using CVF. An identical project using the identical code created using IVF and VS2005 Pro showed that WININET.LIB had to be added under project...properties...Linker...Input...additional dependencies, as the attached screen shot shows. This needs to be done for both Debug and Release configurations.&lt;BR /&gt;&lt;BR /&gt;The IVF solution showED one bug, in that the ' iret =' part of the first messageBox text string is screwed up (see attachment) although subsequent messageboxes show correct text(see attachment). If I put the concatenated text into a seperate character string and include that into the message box instead, I get an access violation. Wierd! I will investigate this further.&lt;BR /&gt;&lt;BR /&gt;Well I investigated further and I think it is a stack problem caused by the wrong calling convention.&lt;BR /&gt;Please replace &lt;BR /&gt;!DEC$ ATTRIBUTES C, ALIAS :'_InternetGetConnectedState@8'::InternetGetConnectedState&lt;BR /&gt;with&lt;BR /&gt;!DEC$ ATTRIBUTES STDCALL, ALIAS :'_InternetGetConnectedState@8'::InternetGetConnectedState&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Jun 2011 10:50:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/m-p/813098#M43895</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2011-06-03T10:50:35Z</dc:date>
    </item>
    <item>
      <title>Checking internet connection from fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/m-p/813099#M43896</link>
      <description>&lt;DIV&gt;Okay, thanks Les and Anthony. I've now made the change to the !DEC$ ATTRIBUTES and added the static library to the link process and it runs fine for me - I don't get the screw-up you see with the first dialog it returning 1 or 0 depending on whether or not I'm connected. Out of interest why are we not able to make use of the wininet.dll?&lt;/DIV&gt;</description>
      <pubDate>Fri, 03 Jun 2011 12:06:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/m-p/813099#M43896</guid>
      <dc:creator>acar</dc:creator>
      <dc:date>2011-06-03T12:06:59Z</dc:date>
    </item>
    <item>
      <title>Checking internet connection from fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/m-p/813100#M43897</link>
      <description>If you right-click on the executable and select 'View Dependencies', Dependency Walker should open (always supposing you have it installed) and it will show you that WININET.DLL is indeed required.&lt;BR /&gt;&lt;BR /&gt;I have no idea how my VS 2005 knows where the export library WININET.LIB associated with the DLL is located on my system and therefore have no idea how VS automatically finds it when it is listed as an Additional dependency. Perhaps Steve can oblige?. On my system, I have found that WININET.LIB is located at a couple of places, both in a PlatformSDK /Lib/ folder.</description>
      <pubDate>Fri, 03 Jun 2011 12:40:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/m-p/813100#M43897</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2011-06-03T12:40:03Z</dc:date>
    </item>
    <item>
      <title>Checking internet connection from fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/m-p/813101#M43898</link>
      <description>WININET.LIB is part of the Platform SDK (now Windows SDK) and the path to this is part of the default set of library folders. However, I keep encountering customers who for some reason don't get that set up correctly. The DLL it "exports" is a system DLL.</description>
      <pubDate>Fri, 03 Jun 2011 15:21:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/m-p/813101#M43898</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-06-03T15:21:42Z</dc:date>
    </item>
    <item>
      <title>Checking internet connection from fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/m-p/813102#M43899</link>
      <description>Thanks. A little delving using the Visual Studio menu items Tools...Options...Projects+Solutions...VC++ Directories...Show directories for...Libraries gives the list of library search paths using VS environment variables, Variables such as VSInstallDir. &lt;BR /&gt;&lt;BR /&gt;The only way I have found of actually viewing the contents of a particular VS environment variable was to open the VSVARS32.BAT in the \Program Files\Visual Studio 8\common7\tools\ folder and browse it in an Editor. Is there a way from within Visual Studio?&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Jun 2011 16:05:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/m-p/813102#M43899</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2011-06-03T16:05:27Z</dc:date>
    </item>
    <item>
      <title>Checking internet connection from fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/m-p/813103#M43900</link>
      <description>Tools &amp;gt; Options &amp;gt; Intel Visual Fortran &amp;gt; General &amp;gt; Build Options &amp;gt; Show environment in log&lt;BR /&gt;&lt;BR /&gt;Then do a build.&lt;BR /&gt;&lt;BR /&gt;Reading the .bat file will not help you here - some of the variables are generated dynamically by Visual Studio.</description>
      <pubDate>Fri, 03 Jun 2011 16:59:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/m-p/813103#M43900</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-06-03T16:59:47Z</dc:date>
    </item>
  </channel>
</rss>

