Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Kinda new...need help

Kinda new...need help

Scheduled Pinned Locked Moved C / C++ / MFC
businessperformancehelpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Matthew Devine
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups