Adblock breaks this site

More Help needed by Esuom...

Discussion in 'Programming General' started by Esuom, Mar 18, 2009.

  1. Esuom

    Esuom Guru
    Banned

    Joined:
    May 3, 2007
    Posts:
    1,731
    Referrals:
    2
    Sythe Gold:
    0
    More Help needed by Esuom...

    Okay, I had a friend write me up a few functions that I needed, the problem is, I haven't seen him in a while and the function I need, I don't understand 100% on how to use.

    I am trying to use...

    Code:
    string GetSource(char m_strURL[])
    {
    	if ( m_strURL == "" )
    	{
    		return "";
        }
    
    	HINTERNET hINet, hFile;
    	hINet = InternetOpen("InetURL/1.0", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 );
    
    	if ( !hINet )
    	{
    		return "";
    	}
    
    	hFile = InternetOpenUrl( hINet, m_strURL, NULL, 0, 0, 0 ) ;
        string m_strContents;
    
    	if ( hFile )
    	{
    		CHAR buffer[1024];
    		DWORD dwRead;
    		while ( InternetReadFile( hFile, buffer, 1023, &dwRead ) )\
    		{
    			if ( dwRead == 0 )
    				break;
    			buffer[dwRead] = 0;
    			m_strContents += buffer;
    		}
    		InternetCloseHandle( hFile );
    	}
    	InternetCloseHandle( hINet );  
        return m_strContents;    
    }
    

    I know what it is supposed to do, I just can't figure out the set up.


    Thanks for any help.
     
< Hit Percent | Basic java tutorial. >


 
 
Adblock breaks this site