这篇教程C++ FillMemory函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中FillMemory函数的典型用法代码示例。如果您正苦于以下问题:C++ FillMemory函数的具体用法?C++ FillMemory怎么用?C++ FillMemory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了FillMemory函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ErrMsgvoid Platform_Win32_Sound_SoundStream_DSound::ClearBuffer(int bufferOffset, int bytesToClear) { if (!soundBuffer_) { } // Check the range of the bytesToClear parameter ErrMsg((bufferOffset+bytesToClear)<=size_,"Sound buffer out of range/n"); // Obtain memory address of write block. This will be in two parts // if the block wraps around. LPVOID lpvPtr1; DWORD dwBytes1; LPVOID lpvPtr2; DWORD dwBytes2; HRESULT hr = soundBuffer_->Lock(bufferOffset, bytesToClear, &lpvPtr1, &dwBytes1, &lpvPtr2, &dwBytes2, 0); // If DSERR_BUFFERLOST is returned, restore and retry lock. if (hr==DSERR_BUFFERLOST) { soundBuffer_->Restore(); hr = soundBuffer_->Lock(bufferOffset, bytesToClear, &lpvPtr1, &dwBytes1, &lpvPtr2, &dwBytes2, 0); } ErrMsg(SUCCEEDED(hr),"Couldn't lock sound buffer/n"); // Write to pointers. FillMemory(lpvPtr1, dwBytes1,0); if(lpvPtr2) { FillMemory(lpvPtr2, dwBytes2, 0); } // Release the data back to DirectSound. hr=soundBuffer_->Unlock(lpvPtr1, dwBytes1, lpvPtr2, dwBytes2); ErrMsg(SUCCEEDED(hr),"Couldn't unlock sound buffer/n"); }
开发者ID:RichardMarks,项目名称:Pixie,代码行数:35,
示例2: strcpy_svoid CNetworkLayerTestDlg::OnBnClickedButtonSend(){TRY_CATCH char buf[MAX_PATH]; int len; strcpy_s( buf, MAX_PATH, "Sending ->" ); m_SendList.AddString( buf ); FillMemory( buf, MAX_PATH, 0 ); m_SendText.GetWindowText( buf, MAX_PATH ); m_SendList.AddString( buf ); len = (unsigned int)strlen( buf ); if ( BST_CHECKED == m_AddBreakLine.GetCheck() ) { buf[len] = '/r'; len++; buf[len] = '/n'; len++; } Stream.Send( buf, len ); FillMemory( buf, MAX_PATH, 0 ); strcpy_s( buf, MAX_PATH, "->Sent" ); m_SendList.AddString( buf ); m_SendText.SetWindowText( "" );CATCH_LOG("CNetworkLayerTestDlg::OnBnClickedButtonSend")}
开发者ID:SupportSpace,项目名称:SupportCenter,代码行数:32,
示例3: FillMemoryVOID CPokemonCodec::GetCatcherName(BYTE bCode[POKEMON_TRAINER_NAME_SIZE]){ if(m_pPokemon == NULL) return; if(m_pPokemon->Header.bNickNameLanguage == 0x00) { FillMemory(bCode, POKEMON_TRAINER_NAME_SIZE, 0xFF); } else { switch(m_dwLang) { case lang_jp: // jp version MoveMemory(bCode, m_pPokemon->Header.bCatcherName, 5); bCode[5] = 0xFF; FillMemory(bCode + 6, POKEMON_TRAINER_NAME_SIZE - 6, 0x00); break; default: // en version MoveMemory(bCode, m_pPokemon->Header.bCatcherName, POKEMON_TRAINER_NAME_SIZE); break; } }}
开发者ID:h16o2u9u,项目名称:rtoss,代码行数:25,
示例4: CreateFilebool CSerialPort::Open( LPCTSTR lpszComPort,LPCTSTR lpszConString ,int delay_us){ CString sPort; sPort.Format(_T("////.//%s"), lpszComPort); m_hComm = CreateFile(sPort, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING,0,0); if (m_hComm == INVALID_HANDLE_VALUE) { CString str; GetErrorStr(str); LogMessage(str); return false; } Delay_US = delay_us; // Set Com Settings DCB dcb; FillMemory(&dcb, sizeof(dcb), 0); dcb.DCBlength = sizeof(dcb); if (!BuildCommDCB(lpszConString, &dcb)) { // Couldn't build the DCB. Usually a problem // with the communications specification string. CString str; GetErrorStr(str); LogMessage(str); LogMessage("Seri Port Hatas C++ FillRect函数代码示例 C++ FillList函数代码示例
|