WordApplicationOptionsHelper::~WordApplicationOptionsHelper()
{
	try
	{
		ResetOptions();
		if(m_bCanQuit)
			m_spWordApplication->Quit();
	}
   catch(...) {}
}
HTTPStackHelper::HTTPStackHelper(
  void *pOwner,
  NotifyCallback NotifyCb,
  HTTPCookieMgr& cookieMgr) :
    m_HTTPStateInfo(cookieMgr),
    m_ProxyServerName(NULL),
    m_ProxyServerPort(0),
    m_HTTPState(&(HTTPStackStateObjects::HTTPStateIdleObj)),
    m_pCStreamNetwork(NULL),
    m_pOwner(pOwner),
    m_fNotifyCallback(NotifyCb)
{
  ResetOptions();

  m_NetworkIfaceId = -1;
  m_PrimaryPDPProfileNo = -1;

  m_pCStreamNetwork = CStreamNetwork::CreateInstance(true);
  if (NULL == m_pCStreamNetwork)
  {
    QTV_MSG_PRIO(QTVDIAG_HTTP_STACK, QTVDIAG_PRIO_ERROR,
                 "HTTPStackHelper Failed to create instance of m_pCStreamNetwork");
  }
}
void
HTTPStackHelper::SetState(HTTPStateBase *state)
{
  QTV_MSG_PRIO2(QTVDIAG_HTTP_STACK, QTVDIAG_PRIO_HIGH,
    "HTTPStackHelper::SetState. Transition from '%s' to '%s'",
    m_HTTPState->GetStateName(),
    state->GetStateName());

  m_HTTPState = state;

  // Update state information

  if (&(HTTPStackStateObjects::HTTPStateIdleObj) == state)
  {
    m_HTTPStateInfo.ResetPersistentConnection();
    StartNewRequest();
    ResetOptions();
  }
  else
  if (&(HTTPStackStateObjects::HTTPStateClosedObj) == state)
  {
    m_HTTPStateInfo.ResetPersistentConnection();
  }
}
Ejemplo n.º 4
0
CommandLineParser::~CommandLineParser()
{
  ResetOptions();
}
Ejemplo n.º 5
0
static INT_PTR CALLBACK GcCreateDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
	CVkProto *ppro = (CVkProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
	NMCLISTCONTROL* nmc;

	switch (msg) {
	case WM_INITDIALOG:
		TranslateDialogDefault(hwndDlg);

		ppro = (CVkProto*)lParam;
		SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
		{
			HWND hwndClist = GetDlgItem(hwndDlg, IDC_CLIST);
			SetWindowLongPtr(hwndClist, GWL_STYLE,
				GetWindowLongPtr(hwndClist, GWL_STYLE) |  CLS_CHECKBOXES | CLS_HIDEEMPTYGROUPS | CLS_USEGROUPS | CLS_GREYALTERNATE | CLS_GROUPCHECKBOXES);
			SendMessage(hwndClist, CLM_SETEXSTYLE, CLS_EX_DISABLEDRAGDROP | CLS_EX_TRACKSELECT, 0);

			ResetOptions(hwndDlg);
		}
		return TRUE;

	case WM_NOTIFY:
		nmc = (NMCLISTCONTROL*)lParam;
		if (nmc->hdr.idFrom == IDC_CLIST && nmc->hdr.code == CLN_LISTREBUILT)
			FilterContacts(hwndDlg, ppro);
		break;

	case WM_COMMAND:
		switch (LOWORD(wParam)) {
		case IDCANCEL:
			EndDialog(hwndDlg, 0);
			return TRUE;

		case IDOK:
			HWND hwndClist = GetDlgItem(hwndDlg, IDC_CLIST);
			CMStringA uids;
			for (HANDLE hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) {
				if (ppro->isChatRoom(hContact))
					continue;

				if (int hItem = SendMessage(hwndClist, CLM_FINDCONTACT, (WPARAM)hContact, 0)) {
					if (SendMessage(hwndClist, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) {
						int uid = ppro->getDword(hContact, "ID", 0);
						if (uid != NULL) {
							if (!uids.IsEmpty())
								uids.AppendChar(',');
							uids.AppendFormat("%d", uid);
						}
					}
				}
			}

			TCHAR tszTitle[1024];
			GetDlgItemText(hwndDlg, IDC_TITLE, tszTitle, SIZEOF(tszTitle));
			ppro->CreateNewChat(uids, tszTitle);
			EndDialog(hwndDlg, 0);
			return TRUE;
		}
	}
	return FALSE;
}
Ejemplo n.º 6
0
/**
  * @brief  Function initializes options structure using data from EEPROM.
  * @brief  Options are initialized to default values if version invalid.
  * @param  void
  * @retval void
  */
void InitOptions(void)
{ ReadOptions();
   if (options.version != OPTIONS_VER)
   { ResetOptions();
     WriteOptions(); }
}
Ejemplo n.º 7
0
Game::Game()
:   m_victoryTimer(-1),
    m_recalcTimer(0),
    m_winner(-1),
    m_maxGameTime(-1),
    m_gameTimeWarning(false),
    m_lockVictoryTimer(false),
    m_lastKnownDefcon(5),
    m_gameMode(-1)
{
    //
    // Load game options
    
    TextReader *in = g_fileSystem->GetTextReader( "data/gameoptions.txt" );
	AppAssert(in && in->IsOpen());

    while( in->ReadLine() )
    {
        if( !in->TokenAvailable() ) continue;

        char *param = in->GetNextToken();

        GameOption *option = new GameOption();
        m_options.PutData( option );

        strcpy( option->m_name,     param );
        option->m_min       = atof( in->GetNextToken() );
        option->m_max       = atof( in->GetNextToken() );
        option->m_default   = atof( in->GetNextToken() );
        option->m_change    = atoi( in->GetNextToken() );     
        
        if( option->m_change == 0 )
        {
            // Drop down menu - so load the sub options
            int numOptions = option->m_max - option->m_min;
            numOptions ++;
            for( int i = 0; i < numOptions; ++i )
            {
                in->ReadLine();
                char *subOption = strdup( in->GetRestOfLine() );
                
                // Strip trailing \n and \r
                int stringLength = strlen(subOption);
                if( subOption[stringLength-1] == '\n' ) subOption[stringLength-1] = '\x0';                
                if( subOption[stringLength-2] == '\r' ) subOption[stringLength-2] = '\x0';
                
                option->m_subOptions.PutData( subOption );
            }
        }

        if( option->m_change == -1 )
        {
            // String - load default
            in->ReadLine();
            strcpy( option->m_currentString, in->GetRestOfLine() );
        }
    }

    delete in;


    ResetOptions();

#ifdef TESTBED
    GetOption("MaxTeams")->m_default = 2;
    GetOption("MaxTeams")->m_currentValue = 2;
    GetOption("MaxGameRealTime")->m_default = 15;
    GetOption("MaxGameRealTime")->m_currentValue = 15;
#endif


    m_score.Initialise(MAX_TEAMS);
    m_nukeCount.Initialise(MAX_TEAMS);
    m_totalNukes.Initialise(MAX_TEAMS);

    for( int t = 0; t < MAX_TEAMS; ++t )
    {
        m_score[t] = 0;
        m_nukeCount[t] = 0;
        m_totalNukes[t] = 0;
    }
}