• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ NUMELMS函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: QueryPinInfoReleaseFilter

/*  Display pin */
CDisp::CDisp(IPin *pPin)
{
    PIN_INFO pi;
    TCHAR str[MAX_PIN_NAME];
    CLSID clsid;

    if (pPin) {
       pPin->QueryPinInfo(&pi);
       pi.pFilter->GetClassID(&clsid);
       QueryPinInfoReleaseFilter(pi);
      #ifndef UNICODE
       WideCharToMultiByte(GetACP(), 0, pi.achName, lstrlenW(pi.achName) + 1,
                           str, MAX_PIN_NAME, NULL, NULL);
      #else
       (void)StringCchCopy(str, NUMELMS(str), pi.achName);
      #endif
    } else {
       (void)StringCchCopy(str, NUMELMS(str), TEXT("NULL IPin"));
    }

    size_t len = lstrlen(str)+64;
    m_pString = (PTCHAR) new TCHAR[len];
    if (!m_pString) {
	return;
    }

    #ifdef UNICODE
    LPCTSTR FORMAT_STRING = TEXT("%S(%s)");
    #else
    LPCTSTR FORMAT_STRING = TEXT("%s(%s)");
    #endif 

    (void)StringCchPrintf(m_pString, len, FORMAT_STRING, GuidNames[clsid], str);
}
开发者ID:pixelspark,项目名称:corespark,代码行数:35,代码来源:wxdebug.cpp


示例2: switch

// clashes with REFERENCE_TIME
CDisp::CDisp(LONGLONG ll, int Format)
{
    // note: this could be combined with CDisp(LONGLONG) by
    // introducing a default format of CDISP_REFTIME
    LARGE_INTEGER li;
    li.QuadPart = ll;
    switch (Format) {
	case CDISP_DEC:
	{
	    TCHAR  temp[20];
	    int pos=20;
	    temp[--pos] = 0;
	    int digit;
	    // always output at least one digit
	    do {
		// Get the rightmost digit - we only need the low word
	        digit = li.LowPart % 10;
		li.QuadPart /= 10;
		temp[--pos] = (TCHAR) digit+L'0';
	    } while (li.QuadPart);
	    (void)StringCchPrintf(m_String, NUMELMS(m_String), TEXT("%s"), temp+pos);
	    break;
	}
	case CDISP_HEX:
	default:
	    (void)StringCchPrintf(m_String, NUMELMS(m_String), TEXT("0x%X%8.8X"), li.HighPart, li.LowPart);
    }
};
开发者ID:pixelspark,项目名称:corespark,代码行数:29,代码来源:wxdebug.cpp


示例3: DbgLogInfo

//
// warning -- this function is implemented twice for ansi applications
// linking to the unicode library
//
void WINAPI DbgLogInfo(DWORD Type,DWORD Level,__format_string LPCSTR pFormat,...)
{
    /* Check the current level for this type combination */

    BOOL bAccept = DbgCheckModuleLevel(Type,Level);
    if (bAccept == FALSE) {
        return;
    }

    TCHAR szInfo[2000];

    /* Format the variable length parameter list */

    va_list va;
    va_start(va, pFormat);

    (void)StringCchPrintf(szInfo, NUMELMS(szInfo),
             TEXT("%s(tid %x) %8d : "),
             m_ModuleName,
             GetCurrentThreadId(), timeGetTime() - dwTimeOffset);

    CHAR szInfoA[2000];
    WideCharToMultiByte(CP_ACP, 0, szInfo, -1, szInfoA, NUMELMS(szInfoA), 0, 0);

    (void)StringCchVPrintfA(szInfoA + lstrlenA(szInfoA), NUMELMS(szInfoA) - lstrlenA(szInfoA), pFormat, va);
    (void)StringCchCatA(szInfoA, NUMELMS(szInfoA), "\r\n");

    WCHAR wszOutString[2000];
    MultiByteToWideChar(CP_ACP, 0, szInfoA, -1, wszOutString, NUMELMS(wszOutString));
    DbgOutString(wszOutString);

    va_end(va);
}
开发者ID:1ldk,项目名称:mpc-hc,代码行数:37,代码来源:wxdebug.cpp


示例4: DbgLogInfo

// 
// warning -- this function is implemented twice for ansi applications
// linking to the unicode library
// 
void WINAPI DbgLogInfo(DWORD Type,DWORD Level,const TCHAR *pFormat,...)
{
    
    /* Check the current level for this type combination */

    BOOL bAccept = DbgCheckModuleLevel(Type,Level);
    if (bAccept == FALSE) {
        return;
    }

    TCHAR szInfo[2000];

    /* Format the variable length parameter list */

    va_list va;
    va_start(va, pFormat);

    (void)StringCchCopy(szInfo, NUMELMS(szInfo), m_ModuleName);
    size_t len = lstrlen(szInfo);
    (void)StringCchPrintf(szInfo + len, NUMELMS(szInfo) - len,
             TEXT("(tid %x) %8d : "),
             GetCurrentThreadId(), timeGetTime() - dwTimeOffset);
    len = lstrlen(szInfo);

    (void)StringCchVPrintf(szInfo + len, NUMELMS(szInfo) - len, pFormat, va);

    (void)StringCchCat(szInfo, NUMELMS(szInfo), TEXT("\r\n"));
    DbgOutString(szInfo);

    va_end(va);
}
开发者ID:hgl888,项目名称:nashtest,代码行数:35,代码来源:wxdebug.cpp


示例5: CreateHiddenWindow

BOOL CreateHiddenWindow( HINSTANCE hInstance, TCHAR *szFile )
{
    TCHAR szTitle[MAX_PATH + sizeof(CUTSCENE_NAME) + 5];

    // Set up and register window class
    WNDCLASS wc      = {0};
    wc.lpfnWndProc   = (WNDPROC) WindowProc;
    wc.hInstance     = hInstance;
    wc.lpszClassName = CUTSCENE_NAME;
    if (!RegisterClass(&wc))
        return FALSE;

    // Prevent buffer overrun by restricting size of title to MAX_PATH
    (void)StringCchPrintf(szTitle, NUMELMS(szTitle), TEXT("%s: \0"), CUTSCENE_NAME);
    StringCchCatN(szTitle, NUMELMS(szTitle), szFile, MAX_PATH);

    // Create a window of zero size that will serve as the sink for
    // keyboard input.  If this media file has a video component, then
    // a second ActiveMovie window will be displayed in which the video
    // will be rendered.  Setting keyboard focus on this application window
    // will allow the user to move the video window around the screen, make
    // it full screen, resize, center, etc. independent of the application
    // window.  If the media file has only an audio component, then this will
    // be the only window created.
    g_hwndMain = CreateWindowEx(
        0, CUTSCENE_NAME, szTitle,
        0,            // not visible
        0, 0, 0, 0,
        NULL, NULL, hInstance, NULL );

    return (g_hwndMain != NULL);
}
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:32,代码来源:cutscene.cpp


示例6: UpdateMainTitle

void UpdateMainTitle(void)
{
    TCHAR szTitle[MAX_PATH]={0}, szFile[MAX_PATH]={0};
    HRESULT hr;

    // If no file is loaded, just show the application title
    if (g_szFileName[0] == L'\0')
    {
        hr = StringCchCopy(szTitle, NUMELMS(szTitle), APPLICATIONNAME);
    }

    // Otherwise, show useful information
    else
    {
        // Get file name without full path
        GetFilename(g_szFileName, szFile);

        // Update the window title to show filename and play state
        hr = StringCchPrintf(szTitle, NUMELMS(szTitle), TEXT("Watermark - %s %s%s\0\0"),
                szFile,
                (g_lVolume == VOLUME_SILENCE) ? TEXT("(Muted)\0") : TEXT("\0"),
                (g_psCurrent == Paused) ? TEXT("(Paused)\0") : TEXT("\0"));
    }

    SetWindowText(ghApp, szTitle);
}
开发者ID:AbdoSalem95,项目名称:WindowsSDK7-Samples,代码行数:26,代码来源:watermark.cpp


示例7: DbgDumpObjectRegister

void WINAPI DbgDumpObjectRegister()
{
    TCHAR szInfo[iDEBUGINFO];

    /* Grab the list critical section */

    EnterCriticalSection(&m_CSDebug);
    ObjectDesc *pObject = pListHead;

    /* Scan the object list displaying the name and cookie */

    DbgLog((LOG_MEMORY,2,TEXT("")));
    DbgLog((LOG_MEMORY,2,TEXT("   ID             Object Description")));
    DbgLog((LOG_MEMORY,2,TEXT("")));

    while (pObject) {
        if(pObject->m_wszName) {
            (void)StringCchPrintf(szInfo,NUMELMS(szInfo),TEXT("%5d (%p) %30ls"),pObject->m_dwCookie, &pObject, pObject->m_wszName);
        } else {
            (void)StringCchPrintf(szInfo,NUMELMS(szInfo),TEXT("%5d (%p) %30hs"),pObject->m_dwCookie, &pObject, pObject->m_szName);
        }
        DbgLog((LOG_MEMORY,2,szInfo));
        pObject = pObject->m_pNext;
    }

    (void)StringCchPrintf(szInfo,NUMELMS(szInfo),TEXT("Total object count %5d"),m_dwObjectCount);
    DbgLog((LOG_MEMORY,2,TEXT("")));
    DbgLog((LOG_MEMORY,1,szInfo));
    LeaveCriticalSection(&m_CSDebug);
}
开发者ID:1ldk,项目名称:mpc-hc,代码行数:30,代码来源:wxdebug.cpp


示例8: GetRecentFiles

/*****************************Private*Routine******************************\
* GetRecentFiles
*
* Reads at most MAX_RECENT_FILES from the app's registry entry. 
* Returns the number of files actually read.  
* Updates the File menu to show the "recent" files.
*
\**************************************************************************/
int
GetRecentFiles(
    int iLastCount,
    int iMenuPosition   // Menu position of start of MRU list
    )
{
    int     i;
    TCHAR   FileName[MAX_PATH];
    TCHAR   szKey[32];
    HMENU   hSubMenu;

    //
    // Delete the files from the menu
    //
    hSubMenu = GetSubMenu(GetMenu(hwndApp), 0);

    // Delete the separator at the requested position and all the other 
    // recent file entries
    if(iLastCount != 0)
    {
        DeleteMenu(hSubMenu, iMenuPosition, MF_BYPOSITION);

        for(i = 1; i <= iLastCount; i++)
        {
            DeleteMenu(hSubMenu, ID_RECENT_FILE_BASE + i, MF_BYCOMMAND);
        }
    }

    for(i = 1; i <= MAX_RECENT_FILES; i++)
    {
        DWORD   len;
        TCHAR   szMenuName[MAX_PATH + 3];

        (void)StringCchPrintf(szKey, NUMELMS(szKey), TEXT("File %d\0"), i);

        len = ProfileStringIn(szKey, TEXT(""), FileName, MAX_PATH * sizeof(TCHAR));
        if(len == 0)
        {
            i = i - 1;
            break;
        }

        StringCchCopy(aRecentFiles[i - 1], NUMELMS(aRecentFiles[i-1]), FileName);
        (void)StringCchPrintf(szMenuName, NUMELMS(szMenuName), TEXT("&%d %s\0"), i, FileName);

        if(i == 1)
        {
            InsertMenu(hSubMenu, iMenuPosition, MF_SEPARATOR | MF_BYPOSITION, (UINT)-1, NULL);
        }

        InsertMenu(hSubMenu, iMenuPosition + i, MF_STRING | MF_BYPOSITION,
            ID_RECENT_FILE_BASE + i, szMenuName);
    }

    //
    // i is the number of recent files in the array.
    //
    return i;
}
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:67,代码来源:persist.cpp


示例9: NUMELMS

CDisp::CDisp(double d)
{
#ifdef DEBUG
    (void)StringCchPrintf(m_String, NUMELMS(m_String), TEXT("%.16g"), d);
#else
    (void)StringCchPrintf(m_String, NUMELMS(m_String), TEXT("%d.%03d"), (int) d, (int) ((d - (int) d) * 1000));
#endif
}
开发者ID:pixelspark,项目名称:corespark,代码行数:8,代码来源:wxdebug.cpp


示例10: DbgLog

void CApp::SetAppValues(HINSTANCE hInst, PTSTR szAppName, int iAppTitleResId) 
{
    DbgLog((LOG_TRACE, 5, TEXT("CApp::SetAppValues()"))) ;

        m_hInstance = hInst ;

    StringCchCopy(m_szAppName, NUMELMS(m_szAppName), APPNAME);
    LoadString(m_hInstance, IDS_APP_TITLE, m_szAppTitle, NUMELMS(m_szAppTitle)) ;
}
开发者ID:AbdoSalem95,项目名称:WindowsSDK7-Samples,代码行数:9,代码来源:dvdsample.cpp


示例11: SetActive

///////////////////////////////////////////////////////////////
//
// CPerfStatFunctionTimingImpl::DoPulse
//
//
//
///////////////////////////////////////////////////////////////
void CPerfStatFunctionTimingImpl::DoPulse ( void )
{
    // Maybe turn off stats gathering if nobody is watching
    if ( m_bIsActive && m_TimeSinceLastViewed.Get () > 15000 )
        SetActive ( false );

    // Do nothing if not active
    if ( !m_bIsActive )
    {
        m_TimingMap.empty ();
        return;
    }

    // Check if time to cycle the stats
    if ( m_TimeSinceUpdate.Get () >= 5000 )
    {
        m_TimeSinceUpdate.Reset ();

        // For each timed function
        for ( std::map < SString, SFunctionTimingInfo >::iterator iter = m_TimingMap.begin () ; iter != m_TimingMap.end () ; )
        {
            SFunctionTimingInfo& item = iter->second;
            // Update history
            item.iPrevIndex = ( item.iPrevIndex + 1 ) % NUMELMS( item.history );
            item.history[ item.iPrevIndex ] = item.now5s;

            // Reset accumulator
            item.now5s.uiNumCalls = 0;
            item.now5s.fTotalMs = 0;
            item.now5s.fPeakMs = 0;

            // Recalculate last 60 second stats
            item.prev60s.uiNumCalls = 0;
            item.prev60s.fTotalMs = 0;
            item.prev60s.fPeakMs = 0;
            for ( uint i = 0 ; i < NUMELMS( item.history ) ; i++ )
            {
                const STiming& slot = item.history[i];
                item.prev60s.uiNumCalls += slot.uiNumCalls;
                item.prev60s.fTotalMs += slot.fTotalMs;
                item.prev60s.fPeakMs = Max ( item.prev60s.fPeakMs, slot.fPeakMs );
            }

            // Remove from map if no calls in the last 60s
            if ( item.prev60s.uiNumCalls == 0 )
                m_TimingMap.erase ( iter++ );
            else
                ++iter;
        }
    }

    //
    // Update PeakUs threshold
    //
    m_PeakUsRequiredHistory.RemoveOlderThan ( 10000 );
    m_PeakUsThresh = m_PeakUsRequiredHistory.GetLowestValue ( DEFAULT_THRESH_MS * 1000 );
}
开发者ID:EagleShen,项目名称:MTA,代码行数:64,代码来源:CPerfStat.FunctionTiming.cpp


示例12: SetRecentFiles

/*****************************Private*Routine******************************\
* SetRecentFiles
*
* Writes the most recent files to the registry.
* Purges the oldest file if necessary.
*
\**************************************************************************/
int
SetRecentFiles(
    TCHAR *FileName,    // File name to add
    int iCount,         // Current count of files
    int iMenuPosition   // Menu position of start of MRU list
    )
{
    TCHAR   FullPathFileName[MAX_PATH];
    TCHAR   *lpFile=0;
    TCHAR   szKey[32];
    int     iCountNew, i;

    //
    // Check for duplicates - we don't allow them
    //
    for(i = 0; i < iCount; i++)
    {
        if(0 == lstrcmpi(FileName, aRecentFiles[i]))
        {
            return iCount;
        }
    }

    //
    // Throw away the oldest entry
    //
    MoveMemory(&aRecentFiles[1], &aRecentFiles[0],
               sizeof(aRecentFiles) - sizeof(aRecentFiles[1]));

    //
    // Copy in the full path of the new file.
    //
    GetFullPathName(FileName, MAX_PATH, FullPathFileName, &lpFile);
    StringCchCopy(aRecentFiles[0], NUMELMS(aRecentFiles[0]), FullPathFileName);

    //
    // Update the count of files, saturate to MAX_RECENT_FILES.
    //
    iCountNew = min(iCount + 1, MAX_RECENT_FILES);

    //
    // Clear the old stuff and the write out the recent files to disk
    //
    for(i = 1; i <= iCountNew; i++)
    {
        (void)StringCchPrintf(szKey, NUMELMS(szKey),TEXT("File %d\0"), i);
        ProfileStringOut(szKey, aRecentFiles[i - 1]);
    }

    //
    // Update the file menu
    //
    GetRecentFiles(iCount, iMenuPosition);

    return iCountNew;  // the updated count of files.
}
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:63,代码来源:persist.cpp


示例13: switch

BOOL CALLBACK CTitleDlg::TitleDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
    static CTitleDlg * pThis; 

    switch (message)
    {
        case WM_INITDIALOG:
        {
            pThis = reinterpret_cast<CTitleDlg *>(lParam); // get a pointer to the calling object
        
            // set default values
            TCHAR buf[10];
            HRESULT hr = StringCchPrintf(buf, NUMELMS(buf), TEXT("%u\0"), pThis->m_ulTitle); 
            SetDlgItemText(hDlg, IDC_PLAYCHAPTER, buf);
            hr = StringCchPrintf(buf, NUMELMS(buf), TEXT("%u\0"), pThis->m_ulChapter); 
            SetDlgItemText(hDlg, IDC_PLAYCHAPTER, buf);
        
            //set up spin control
            HWND hEBox = GetDlgItem(hDlg, IDC_PLAYCHAPTER);
            CreateUpDownControl(WS_CHILD | WS_BORDER | WS_VISIBLE | UDS_SETBUDDYINT | UDS_ALIGNRIGHT,
                10, 10, 50, 50, hDlg, ID_SPINCONTROL, pThis->m_hInstance, hEBox, 999, 1, 1);

            hEBox = GetDlgItem(hDlg, IDC_PLAYTITLE);
            CreateUpDownControl(WS_CHILD | WS_BORDER | WS_VISIBLE | UDS_SETBUDDYINT | UDS_ALIGNRIGHT,
                10, 10, 50, 50, hDlg, ID_SPINCONTROL, pThis->m_hInstance, hEBox, 99, 1, 1);

            return TRUE;
        }

        case WM_COMMAND:
            switch (LOWORD(wParam))
            {
                case IDOK:
                {
                    // Set the Title specified by the user
                    TCHAR buf[10];
                    GetDlgItemText(hDlg, IDC_PLAYCHAPTER, buf, sizeof(buf)/sizeof(TCHAR));
                    pThis->m_ulChapter = _ttoi(buf);

                    GetDlgItemText(hDlg, IDC_PLAYTITLE, buf, sizeof(buf)/sizeof(TCHAR));
                    pThis->m_ulTitle = _ttoi(buf);

                    EndDialog(hDlg, TRUE);
                    return TRUE;
                }

                case IDCANCEL:
                    EndDialog(hDlg, FALSE);
                    return TRUE;
            }
            break;
    }

    return FALSE;
}
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:55,代码来源:dialogs.cpp


示例14: StringFromGUID2

CDisp::CDisp(REFCLSID clsid)
{
    WCHAR strClass[CHARS_IN_GUID+1];
    StringFromGUID2(clsid, strClass, sizeof(strClass) / sizeof(strClass[0]));
    ASSERT(sizeof(m_String)/sizeof(m_String[0]) >= CHARS_IN_GUID+1);
    #ifdef UNICODE 
    (void)StringCchPrintf(m_String, NUMELMS(m_String), TEXT("%s"), strClass);
    #else
    (void)StringCchPrintf(m_String, NUMELMS(m_String), TEXT("%S"), strClass);
    #endif  
};
开发者ID:pixelspark,项目名称:corespark,代码行数:11,代码来源:wxdebug.cpp


示例15: NUMELMS

////////////////////////////////////////////////////////////
//
// CClientSound::SetFxEffect
//
//
//
////////////////////////////////////////////////////////////
bool CClientSound::SetFxEffect ( uint uiFxEffect, bool bEnable )
{
    if ( uiFxEffect >= NUMELMS( m_EnabledEffects ) )
        return false;

    m_EnabledEffects[uiFxEffect] = bEnable;

    if ( m_pAudio )
        m_pAudio->SetFxEffects ( &m_EnabledEffects[0], NUMELMS( m_EnabledEffects ) );

    return true;
}
开发者ID:ntauthority,项目名称:openvice,代码行数:19,代码来源:CClientSound.cpp


示例16: TextDlgProc

LRESULT CALLBACK TextDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    static TCHAR szSaveText[DYNAMIC_TEXT_SIZE]={0};

    switch (message)
    {
        case WM_INITDIALOG:
            // Save current dynamic text so that we can temporarily modify
            // the dynamic text during font adjustment
            _tcsncpy(szSaveText, g_szAppText, NUMELMS(szSaveText));
            SendMessage(GetDlgItem(hWnd, IDC_EDIT_TEXT), EM_LIMITTEXT, DYNAMIC_TEXT_SIZE, 0L);
            SetWindowText(GetDlgItem(hWnd, IDC_EDIT_TEXT), g_szAppText);
            return TRUE;

        case WM_COMMAND:
            switch (wParam)
            {
                case IDOK:
                {
                    TCHAR szText[DYNAMIC_TEXT_SIZE];
                    GetWindowText(GetDlgItem(hWnd, IDC_EDIT_TEXT), szText, DYNAMIC_TEXT_SIZE);
                    _tcsncpy(g_szAppText, szText, NUMELMS(g_szAppText));
                    BlendApplicationText(ghApp, g_szAppText);
                    EndDialog(hWnd, TRUE);
                    return TRUE;
                }
                break;

                case IDCANCEL:
                    // Restore the original text in case it was modified
                    // and previewed while adjusting the font
                    _tcsncpy(g_szAppText, szSaveText, NUMELMS(g_szAppText));
                    BlendApplicationText(ghApp, g_szAppText);
                    EndDialog(hWnd, TRUE);
                    break;

                case IDC_SET_FONT:
                {
                    TCHAR szTempText[DYNAMIC_TEXT_SIZE]={0};

                    // Change the current font
                    g_hFont = UserSelectFont();   

                    // Start displaying the text that is currently in the edit box
                    GetWindowText(GetDlgItem(hWnd, IDC_EDIT_TEXT), szTempText, DYNAMIC_TEXT_SIZE);
                    BlendApplicationText(ghApp, szTempText);
                }
                break;
            }
            break;
    }
    return FALSE;
}
开发者ID:chinajeffery,项目名称:dx_sdk,代码行数:53,代码来源:ticker.cpp


示例17: ConformResourcePath

//
// Try to make a path relative to the 'resources/' directory
//
SString SharedUtil::ConformResourcePath ( const char* szRes, bool bConvertToUnixPathSep )
{
    // Remove up to first '/resources/'
    // else
    // remove up to first '/resource-cache/unzipped/'
    // else
    // remove up to first '/http-client-protected-files/'
    // else
    // remove up to first '/deathmatch/'
    // else
    // if starts with '...'
    //  remove up to first '/'

    SString strDelimList[] = { "/resources/", "/resource-cache/unzipped/", "/http-client-files-protected/", "/deathmatch/" };
    SString strText = szRes ? szRes : "";
    char cPathSep;

    // Handle which path sep char
#ifdef WIN32
    if ( !bConvertToUnixPathSep )
    {
        cPathSep = '\\';
        for ( unsigned int i = 0 ; i < NUMELMS ( strDelimList ) ; i++ )
            strDelimList[i] = strDelimList[i].Replace ( "/", "\\" );
        strText = strText.Replace ( "/", "\\" );
    }
    else
#endif
    {
        cPathSep = '/';
        for ( unsigned int i = 0 ; i < NUMELMS ( strDelimList ) ; i++ )
            strDelimList[i] = strDelimList[i].Replace ( "\\", "/" );
        strText = strText.Replace ( "\\", "/" );
    }

    for ( unsigned int i = 0 ; i < NUMELMS ( strDelimList ) ; i++ )
    {
        // Remove up to first occurrence
        int iPos = strText.find ( strDelimList[i] );
        if ( iPos >= 0 )
            return strText.substr ( iPos + strDelimList[i].length () );
    }

    if ( strText.substr ( 0, 3 ) == "..." )
    {
        // Remove up to first '/'
        int iPos = strText.find ( cPathSep );
        if ( iPos >= 0 )
            return strText.substr ( iPos + 1 );
    }

    return strText;
}
开发者ID:0x688,项目名称:gtasa_crashfix,代码行数:56,代码来源:SharedUtil.Misc.hpp


示例18: DbgMsg

    void DbgMsg( char* szMessage, ... )
    {
        char szFullMessage[MAX_PATH];
        char szFormatMessage[MAX_PATH];

        // format message
        va_list ap;
        va_start(ap, szMessage);
        (void)StringCchVPrintfA( szFormatMessage, NUMELMS(szFormatMessage), szMessage, ap );
        va_end(ap);
        (void)StringCchCatA( szFormatMessage, NUMELMS(szFormatMessage), "\n" );
        (void)StringCchCopyA( szFullMessage, NUMELMS(szFullMessage), "~*~*~*~*~*~ " );
        (void)StringCchCatA( szFullMessage, NUMELMS(szFullMessage), szFormatMessage );
        OutputDebugStringA( szFullMessage );
    }
开发者ID:hgl888,项目名称:nashtest,代码行数:15,代码来源:MultiVMR9.cpp


示例19: AMovieSetupUnregisterServer

STDAPI
AMovieSetupUnregisterServer( CLSID clsServer )
{
  // convert CLSID uuid to string and write
  // out subkey CLSID\{}
  //
  OLECHAR szCLSID[CHARS_IN_GUID];
  HRESULT hr = StringFromGUID2( clsServer
                              , szCLSID
                              , CHARS_IN_GUID );
  ASSERT( SUCCEEDED(hr) );

  TCHAR achBuffer[MAX_KEY_LEN];
  (void)StringCchPrintf( achBuffer, NUMELMS(achBuffer), CLSID_KEY_FORMAT_STRING, szCLSID );

  // delete subkey
  //

  hr = EliminateSubKey( HKEY_CLASSES_ROOT, achBuffer );
  ASSERT( SUCCEEDED(hr) );

  // return
  //
  return NOERROR;
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:25,代码来源:dllsetup.cpp


示例20: UpdateFrameStats

///////////////////////////////////////////////////////////////
//
// CMemStats::UpdateFrameStats
//
// Update values that are measured each frame
//
///////////////////////////////////////////////////////////////
void CMemStats::UpdateFrameStats ( void )
{

    m_MemStatsNow.d3dMemory = g_pDeviceState->MemoryState;

    static CProxyDirect3DDevice9::SResourceMemory* const nowList[] = {    &m_MemStatsNow.d3dMemory.StaticVertexBuffer, &m_MemStatsNow.d3dMemory.DynamicVertexBuffer,
                                                                                &m_MemStatsNow.d3dMemory.StaticIndexBuffer, &m_MemStatsNow.d3dMemory.DynamicIndexBuffer,
                                                                                &m_MemStatsNow.d3dMemory.StaticTexture, &m_MemStatsNow.d3dMemory.DynamicTexture,
                                                                                &m_MemStatsNow.d3dMemory.Effect };

    static CProxyDirect3DDevice9::SResourceMemory* const maxList[] = {    &m_MemStatsMax.d3dMemory.StaticVertexBuffer, &m_MemStatsMax.d3dMemory.DynamicVertexBuffer,
                                                                                &m_MemStatsMax.d3dMemory.StaticIndexBuffer, &m_MemStatsMax.d3dMemory.DynamicIndexBuffer,
                                                                                &m_MemStatsMax.d3dMemory.StaticTexture, &m_MemStatsMax.d3dMemory.DynamicTexture,
                                                                                &m_MemStatsMax.d3dMemory.Effect };

    CProxyDirect3DDevice9::SResourceMemory* const prevList[] = {   &m_MemStatsPrev.d3dMemory.StaticVertexBuffer, &m_MemStatsPrev.d3dMemory.DynamicVertexBuffer,
                                                                                &m_MemStatsPrev.d3dMemory.StaticIndexBuffer, &m_MemStatsPrev.d3dMemory.DynamicIndexBuffer,
                                                                                &m_MemStatsPrev.d3dMemory.StaticTexture, &m_MemStatsPrev.d3dMemory.DynamicTexture,
                                                                                &m_MemStatsPrev.d3dMemory.Effect };

    for ( uint i = 0 ; i < NUMELMS( nowList ) ; i++ )
    {
        maxList[i]->iLockedCount = std::max ( maxList[i]->iLockedCount, nowList[i]->iLockedCount - prevList[i]->iLockedCount );
        prevList[i]->iLockedCount = nowList[i]->iLockedCount;
    }
}
开发者ID:ljnx86,项目名称:mtasa-blue,代码行数:33,代码来源:CMemStats.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ NUMERIC_POINTER函数代码示例发布时间:2022-05-30
下一篇:
C++ NUMELEMS函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap