コード例 #1
0
ファイル: AdoCommand.cpp プロジェクト: github188/DBProcess
CAdoCommand::CAdoCommand(CAdoConnection* pAdoConnection, CString strCommandText, CommandTypeEnum CommandType)
{
	///创建 Connection 对象---------------------------
	m_pCommand.CreateInstance("ADODB.Command");
	#ifdef _DEBUG
	if (m_pCommand == NULL)
	{
		AfxMessageBox("Command 对象创建失败! 请确认是否初始化了Com环境.");
	}
	#endif
	ASSERT(m_pCommand != NULL);
	ASSERT(pAdoConnection != NULL);
	SetConnection(pAdoConnection);
	if (strCommandText != _T(""))
	{
		SetCommandText(LPCTSTR(strCommandText));
	}
	SetCommandType(CommandType);
}
コード例 #2
0
//----  --------------------------------------------------------------------------------------------------------
// Function:	TimerProc
// Required:	HWND hwnd - Unused
//		UINT uMsg - Unused
//		UINT idEvent - The event type
//		DWORD dwTime - Unused
// Returns:	None
// Purpose:	Tells us our timer tick has occurred - so update text with new time
//----  --------------------------------------------------------------------------------------------------------
LRESULT Applet::DoTimer(UINT idEvent)
{
  std::wstring tmp;

  if (idEvent == MOUSE_TIMER)
  {
    return BaseApplet::DoTimer(idEvent);
  }

  // Only draw the time if this is a timer event and the edit box isn't focused
  if (idEvent == ID_CLOCKTIMER)
  {
    time_t tVal;
    struct tm* stVal;

    _tzset(); /**< Grab the current timezone information for localtime to do it's job correctly */
    time(&tVal); /**< Grab the raw time */
    stVal = localtime(&tVal); /**< Format the rawtime to localtime */

    // Format the time
    tmp = ELwcsftime(pSettings->GetDisplayTimeFormat(), stVal);
    SetCommandText(tmp);

    tmp = ELwcsftime(pSettings->GetDisplayTipFormat(), stVal);
    UpdateTip(tmp);

    if (IsWindowVisible(mainWnd))
    {
      DrawAlphaBlend();
    }

    return 0;
  }

  return 1;
}
コード例 #3
0
ファイル: SQLite.cpp プロジェクト: wyxy2005/library
SQLiteCommand::SQLiteCommand(SQLite* pSqlite, LPCTSTR lpSql) :
m_pSqlite(pSqlite),
m_pStmt(NULL)
{
	SetCommandText(lpSql);
}