Kinda new...need help
-
Alright I'm alittle new to this whole business and was wondering if I could get some help adding code to an existing project. I already have most of the code that needs to be added I'm just not quite sure what specifics need to be edited. void CMFToolbar::SetOpenLoadProxy() { const char* conn_name="DefaultConnectionSettings"; const char* proxy_full_addr = "localhost:5115"; INTERNET_PER_CONN_OPTION_LIST list; DWORD flag ; if ( InternetGetConnectedState ( &flag, NULL ) ) { if ( flag & INTERNET_CONNECTION_PROXY ) { SetDefaultProxy(); }else { DWORD dwBufSize = sizeof(list); // Fill out list struct. list.dwSize = sizeof(list); // NULL == LAN, otherwise connectoid name. list.pszConnection = (LPTSTR)conn_name; // Set three options. list.dwOptionCount = 3; list.pOptions = new INTERNET_PER_CONN_OPTION[3]; // Make sure the memory was allocated. if(NULL == list.pOptions) { // Return FALSE if the memory wasn't allocated. OutputDebugString("failed to allocat memory in SetConnectionOptions()"); } // Set flags. list.pOptions[0].dwOption = INTERNET_PER_CONN_FLAGS; list.pOptions[0].Value.dwValue = PROXY_TYPE_DIRECT | PROXY_TYPE_PROXY; // Set proxy name. list.pOptions[1].dwOption = INTERNET_PER_CONN_PROXY_SERVER; list.pOptions[1].Value.pszValue = (LPTSTR)proxy_full_addr;//"http://proxy:80"; // Set proxy override. list.pOptions[2].dwOption = INTERNET_PER_CONN_PROXY_BYPASS; list.pOptions[2].Value.pszValue = "localhost; 127.0.0.1"; // Set the options on the connection. InternetSetOption(NULL,INTERNET_OPTION_PER_CONNECTION_OPTION, &list, dwBufSize); // Free the allocated memory. delete [] list.pOptions; InternetSetOption(NULL, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0); InternetSetOption(NULL, INTERNET_OPTION_REFRESH , NULL, 0); } } The following code is code I was given that will apparently scan a properties file for two specific fields. I know I need to add the code to open the file but I'm not sure what I would need to do after that? char* whitespace_ltrim(char * pszSource) { char* cp = pszSource; if (cp && *cp) { while (isspace(*cp)) ++cp; if (cp != pszSource) memcpy(pszSource, cp, (strlen(cp)+1)*sizeof(char)); } return pszSource; } char* whitespace_rtrim(char* pszSource) { char* cp = pszSource; if (cp && *cp) { int bNonSpaceSeen = 0; /* check if