当前位置: 首页>>代码示例>>C++>>正文


C++ GetError函数代码示例

本文整理汇总了C++中GetError函数的典型用法代码示例。如果您正苦于以下问题:C++ GetError函数的具体用法?C++ GetError怎么用?C++ GetError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GetError函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ZeroMemory

static char *execute(char *command, int wait) /* {{{1 */
{
	STARTUPINFO si;
	PROCESS_INFORMATION pi;
	ZeroMemory(&si, sizeof(si));
	ZeroMemory(&pi, sizeof(pi));
	si.cb = sizeof(si);
	if (CreateProcess(0, command, 0, 0, 0, CREATE_NO_WINDOW, 0, 0, &si, &pi)) {
		if (wait) {
			WaitForSingleObject(pi.hProcess, INFINITE);
			/* long exit_code; */
			/* TODO: GetExitCodeProcess( pi.hProcess, &exit_code); */
			CloseHandle(pi.hProcess);
			CloseHandle(pi.hThread);
		}
		return Success(NULL);
	} else {
		return Failure(GetError());
	}
}
开发者ID:adamkuipers,项目名称:.vim,代码行数:20,代码来源:shell.c

示例2: GetError

BOOL CGuiRecordSet::GetCollect(int nIndex,CString& strValue)
{
	_variant_t vt;
	_variant_t vtn;
	vtn.vt = VT_I2;
	try
	{	
		vtn.iVal = nIndex;
		vt = m_rs->Fields->GetItem(vtn)->Value;
		if (vt.vt==VT_BSTR)
		{
			strValue=vt.bstrVal;
			return TRUE;
		}else return FALSE;
	}catch(_com_error &e)
	{
		GetError(e);
		return FALSE;
	}
}
开发者ID:darwinbeing,项目名称:trade,代码行数:20,代码来源:GuiADODB.cpp

示例3: sizeof

float CCoreAudioUnit::GetLatency()
{
  if (!m_audioUnit)
    return 0.0f;

  Float64 latency;
  UInt32 size = sizeof(latency);

  OSStatus ret = AudioUnitGetProperty(m_audioUnit,
    kAudioUnitProperty_Latency, kAudioUnitScope_Global, 0, &latency, &size);

  if (ret)
  {
    CLog::Log(LOGERROR, "CCoreAudioUnit::GetLatency: "
      "Unable to set AudioUnit latency. Error = %s", GetError(ret).c_str());
    return 0.0f;
  }

  return latency;
}
开发者ID:misa17,项目名称:xbmc,代码行数:20,代码来源:CoreAudioUnit.cpp

示例4: main

/**
 * Updates the status (active/inactive) of an iam user's access key, based on
 * command line input
 */
int main(int argc, char** argv)
{
    if(argc != 4) {
        PrintUsage();
        return 1;
    }

    Aws::String user_name(argv[1]);
    Aws::String accessKeyId(argv[2]);

    auto status =
        Aws::IAM::Model::StatusTypeMapper::GetStatusTypeForName(argv[3]);

    if (status == Aws::IAM::Model::StatusType::NOT_SET) {
        PrintUsage();
        return 1;
    }

    Aws::SDKOptions options;
    Aws::InitAPI(options);

    {
        Aws::IAM::IAMClient iam;
        Aws::IAM::Model::UpdateAccessKeyRequest request;
        request.SetUserName(user_name);
        request.SetAccessKeyId(accessKeyId);
        request.SetStatus(status);

        auto outcome = iam.UpdateAccessKey(request);
        if (outcome.IsSuccess()) {
            std::cout << "Successfully updated status of access key " <<
                accessKeyId << " for user " << user_name << std::endl;
        } else {
            std::cout << "Error updated status of access key " << accessKeyId <<
                " for user " << user_name << ": " <<
                outcome.GetError().GetMessage() << std::endl;
        }
    }
    Aws::ShutdownAPI(options);
    return 0;
}
开发者ID:ronhash10,项目名称:aws-doc-sdk-examples,代码行数:45,代码来源:update_access_key.cpp

示例5: while

bool CParseBase::BasicParseLoop(CCodeElementList *pCodeList)
{
	CObjectClass *pOC;
	
	while((pOC = GetNextObjectClass(m_iCurLine)) != 0)
	{
		if (!pOC->Parse(*this, *pCodeList))
			return false;
	}

	if (m_iCurPos >= (int) m_msText[m_iCurLine].csText.Len())
	{
		SetError(CPB_EOL);	// End of Line
		return false;
	}
	
	if (GetError() != CPB_NOERROR)
		return false;

	return true;
}
开发者ID:foobarz,项目名称:CLUCalcLinux,代码行数:21,代码来源:ParseBase.cpp

示例6: sizeof

Float64 CCoreAudioDevice::GetNominalSampleRate()
{
  if (!m_DeviceId)
    return 0.0f;

  AudioObjectPropertyAddress  propertyAddress;
  propertyAddress.mScope    = kAudioDevicePropertyScopeOutput;
  propertyAddress.mElement  = 0;
  propertyAddress.mSelector = kAudioDevicePropertyNominalSampleRate;

  Float64 sampleRate = 0.0f;
  UInt32  propertySize = sizeof(Float64);
  OSStatus ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &propertySize, &sampleRate);
  if (ret != noErr)
  {
    CLog::Log(LOGERROR, "CCoreAudioDevice::GetNominalSampleRate: "
      "Unable to retrieve current device sample rate. Error = %s", GetError(ret).c_str());
    return 0.0f;
  }
  return sampleRate;
}
开发者ID:0xheart0,项目名称:xbmc,代码行数:21,代码来源:CoreAudioDevice.cpp

示例7: if

BOOL CGuiRecordSet::GetCollect(LPCTSTR lpField,int& nValue)
{
	_variant_t vt;
	try
	{
		vt = m_rs->Fields->GetItem(lpField)->Value;
		if (vt.vt==VT_I2)
		{
			nValue=vt.intVal;
			return TRUE;
		}else if (vt.vt==VT_BOOL)
		{
			nValue=vt.boolVal;
			return TRUE;
		}else return FALSE;
	}catch(_com_error &e)
	{
		GetError(e);
		return FALSE;
	}
}
开发者ID:darwinbeing,项目名称:trade,代码行数:21,代码来源:GuiADODB.cpp

示例8: AudioUnitSetProperty

bool CAUOutputDevice::SetCurrentDevice(AudioDeviceID deviceId)
{
  if (!m_audioUnit)
    return false;

  OSStatus ret = AudioUnitSetProperty(m_audioUnit, kAudioOutputUnitProperty_CurrentDevice,
    kAudioUnitScope_Global, kOutputBus, &deviceId, sizeof(AudioDeviceID));
  if (ret)
  {
    CLog::Log(LOGERROR, "CCoreAudioUnit::SetCurrentDevice: "
      "Unable to set current device. Error = %s", GetError(ret).c_str());
    return false;
  }

  m_DeviceId = deviceId;

  CLog::Log(LOGDEBUG, "CCoreAudioUnit::SetCurrentDevice: "
    "Current device 0x%08x", (uint)m_DeviceId);

  return true;
}
开发者ID:JohnsonAugustine,项目名称:xbmc-rbp,代码行数:21,代码来源:CoreAudioUnit.cpp

示例9: sizeof

bool CAUOutputDevice::SetChannelMap(CoreAudioChannelList* pChannelMap)
{
  // The number of array elements must match the
  // number of output channels provided by the device
  if (!m_audioUnit || !pChannelMap)
    return false;

  UInt32 channels = pChannelMap->size();
  UInt32 size = sizeof(SInt32) * channels;
  SInt32* pMap = new SInt32[channels];
  for (UInt32 i = 0; i < channels; i++)
    pMap[i] = (*pChannelMap)[i];

  OSStatus ret = AudioUnitSetProperty(m_audioUnit,
    kAudioOutputUnitProperty_ChannelMap, kAudioUnitScope_Input, 0, pMap, size);
  if (ret)
    CLog::Log(LOGERROR, "CCoreAudioUnit::GetBufferFrameSize: "
      "Unable to get current device's buffer size. Error = %s", GetError(ret).c_str());
  delete[] pMap;
  return (!ret);
}
开发者ID:JohnsonAugustine,项目名称:xbmc-rbp,代码行数:21,代码来源:CoreAudioUnit.cpp

示例10: QObject

UbuntuUnityHack::UbuntuUnityHack(QObject* parent)
  : QObject(parent)
{
  // Check if we're on Ubuntu first.
  QFile lsb_release("/etc/lsb-release");
  if (lsb_release.open(QIODevice::ReadOnly)) {
    QByteArray data = lsb_release.readAll();
    if (!data.contains("DISTRIB_ID=Ubuntu")) {
      // It's not Ubuntu - don't do anything.
      return;
    }
  }

  // Get the systray whitelist from gsettings.  If this fails we're probably
  // not running on a system with unity
  QProcess* get = new QProcess(this);
  connect(get, SIGNAL(finished(int)), SLOT(GetFinished(int)));
  connect(get, SIGNAL(error(QProcess::ProcessError)), SLOT(GetError()));
  get->start(kGSettingsFileName, QStringList()
             << "get" << kUnityPanel << kUnitySystrayWhitelist);
}
开发者ID:BrummbQ,项目名称:Clementine,代码行数:21,代码来源:ubuntuunityhack.cpp

示例11: AudioDeviceCreateIOProcID

bool CCoreAudioDevice::AddIOProc()
{
  // Allow only one IOProc at a time
  if (!m_DeviceId || m_IoProc)
    return false;

  OSStatus ret = AudioDeviceCreateIOProcID(m_DeviceId, DirectRenderCallback, this, &m_IoProc);
  if (ret)
  {
    CLog::Log(LOGERROR, "CCoreAudioDevice::AddIOProc: "
      "Unable to add IOProc. Error = %s", GetError(ret).c_str());
    m_IoProc = NULL;
    return false;
  }

  Start();

  CLog::Log(LOGDEBUG, "CCoreAudioDevice::AddIOProc: "
    "IOProc %p set for device 0x%04x", m_IoProc, (uint)m_DeviceId);
  return true;
}
开发者ID:manio,项目名称:xbmc,代码行数:21,代码来源:CoreAudioDevice.cpp

示例12: CreateMainWindow

HWND
CreateMainWindow(LPCTSTR lpCaption,
                 int nCmdShow)
{
    PMAIN_WND_INFO Info;
    HWND hMainWnd = NULL;

    Info = (MAIN_WND_INFO*) HeapAlloc(ProcessHeap,
                     HEAP_ZERO_MEMORY,
                     sizeof(MAIN_WND_INFO));

    if (Info != NULL)
    {
        Info->nCmdShow = nCmdShow;

        hMainWnd = CreateWindowEx(WS_EX_WINDOWEDGE,
                                  szMainWndClass,
                                  lpCaption,
                                  WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
                                  CW_USEDEFAULT,
                                  CW_USEDEFAULT,
                                  680,
                                  450,
                                  NULL,
                                  NULL,
                                  hInstance,
                                  Info);
        if (hMainWnd == NULL)
        {
            //int ret;
            //ret = GetLastError();
            GetError();
            HeapFree(ProcessHeap,
                     0,
                     Info);
        }
    }

    return hMainWnd;
}
开发者ID:RPG-7,项目名称:reactos,代码行数:40,代码来源:mainwnd.c

示例13: CreateMainWindow

HWND
CreateMainWindow(LPCTSTR lpCaption,
                 int nCmdShow)
{
    PMAIN_WND_INFO Info;
    HWND hMainWnd = NULL;

    Info = (PMAIN_WND_INFO)HeapAlloc(ProcessHeap,
                                     HEAP_ZERO_MEMORY,
                                     sizeof(MAIN_WND_INFO));

    if (Info != NULL)
    {
        Info->nCmdShow = nCmdShow;
        Info->Display = DevicesByType;
        Info->bShowHidden = TRUE;

        hMainWnd = CreateWindowEx(WS_EX_WINDOWEDGE,
                                  szMainWndClass,
                                  lpCaption,
                                  WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
                                  CW_USEDEFAULT,
                                  CW_USEDEFAULT,
                                  600,
                                  450,
                                  NULL,
                                  NULL,
                                  hInstance,
                                  Info);
        if (hMainWnd == NULL)
        {
            GetError();
            HeapFree(ProcessHeap,
                     0,
                     Info);
        }
    }

    return hMainWnd;
}
开发者ID:RareHare,项目名称:reactos,代码行数:40,代码来源:mainwnd.c

示例14: main

/**
 * Creates a cloud watch logs subscription filter, based on command line input
 */
int main(int argc, char** argv)
{
    if (argc != 5)
    {
        std::cout << "Usage: " << std::endl << "  put_subscription_filter "
            << "<filter_name> <filter_pattern> <log_group_name> " <<
            "<lambda_function_arn>" << std::endl;
        return 1;
    }

    Aws::SDKOptions options;
    Aws::InitAPI(options);
    {
        Aws::String filter_name(argv[1]);
        Aws::String filter_pattern(argv[2]);
        Aws::String log_group(argv[3]);
        Aws::String dest_arn(argv[4]);

        Aws::CloudWatchLogs::CloudWatchLogsClient cwl;
        Aws::CloudWatchLogs::Model::PutSubscriptionFilterRequest request;
        request.SetFilterName(filter_name);
        request.SetFilterPattern(filter_pattern);
        request.SetLogGroupName(log_group);
        request.SetDestinationArn(dest_arn);
        auto outcome = cwl.PutSubscriptionFilter(request);
        if (!outcome.IsSuccess())
        {
            std::cout << "Failed to create cloudwatch logs subscription filter "
                << filter_name << ": " << outcome.GetError().GetMessage() <<
                std::endl;
        }
        else
        {
            std::cout << "Successfully created cloudwatch logs subscription " <<
                "filter " << filter_name << std::endl;
        }
    }
    Aws::ShutdownAPI(options);
    return 0;
}
开发者ID:gabordc,项目名称:aws-doc-sdk-examples,代码行数:43,代码来源:put_subscription_filter.cpp

示例15: Stop

bool CCoreAudioDevice::RemoveIOProc()
{
  if (!m_DeviceId || !m_IoProc)
    return false;

  Stop();

  OSStatus ret = AudioDeviceDestroyIOProcID(m_DeviceId, m_IoProc);
  if (ret)
    CLog::Log(LOGERROR, "CCoreAudioDevice::RemoveIOProc: "
      "Unable to remove IOProc. Error = %s", GetError(ret).c_str());
  else
    CLog::Log(LOGDEBUG, "CCoreAudioDevice::RemoveIOProc: "
      "IOProc %p removed for device 0x%04x", m_IoProc, (uint)m_DeviceId);
  m_IoProc = NULL; // Clear the reference no matter what

  m_pSource = NULL;

  Sleep(100);

  return true;
}
开发者ID:manio,项目名称:xbmc,代码行数:22,代码来源:CoreAudioDevice.cpp


注:本文中的GetError函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。