C++ (Cpp) _T Examples

C++ (Cpp) _T - 30 examples found. These are the top rated real world C++ (Cpp) examples of _T extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
bool CInfoPanel::Create(HWND hParent)
{
    WNDCLASS wc= {0};
    if(!GetClassInfo(GetModuleHandle(NULL),_T("InfoPanel"),&wc))
    {
        wc.lpszClassName=_T("InfoPanel");
        wc.cbWndExtra=sizeof(void*);
        wc.lpfnWndProc=_WndProc;
        wc.hInstance=GetModuleHandle(NULL);
        if(!RegisterClass(&wc))
            return false;
    }

    m_hWnd = CreateWindow(_T("InfoPanel"),_T(""),WS_CHILD,0,0,10,10,hParent,NULL,GetModuleHandle(NULL),this);
    if(!m_hWnd)
        return false;

    m_hListWnd = CreateWindow(WC_LISTVIEW,_T(""),WS_CHILD|WS_VISIBLE|LVS_REPORT|LVS_NOCOLUMNHEADER|LVS_SINGLESEL,0,0,10,10,m_hWnd,NULL,GetModuleHandle(NULL),NULL);
    if(!m_hListWnd)
        return false;

    ResizeWindowToParent();
    ShowWindow(m_hWnd,SW_SHOW);
    return true;
}
Example #2
0
void CUnBindDlg::OnOK(UINT /*wNotifyCode*/, int /*wID*/, HWND /*hwndCtl*/)
{
    if ( !m_pDiskUnbind->CanAccessExclusive() )
    {
        // TODO : String resource
        MessageBox(
            _T("Disks being accessed by other program/computer cannot be unbound."),
            _T(PROGRAM_TITLE),
            MB_OK | MB_ICONWARNING
        );
        return;
    }
    try {
        m_pDiskUnbind->OpenExclusive();
        m_unboundDisks = m_pDiskUnbind->UnBind( m_pDiskUnbind );
        m_pDiskUnbind->CommitDiskInfo();
        m_pDiskUnbind->Close();
    }
    catch( CNDASException & )
    {
        // TODO : ERROR : Fail to unbind
        // Rollback?
        m_pDiskUnbind->Close();
    }
    EndDialog(IDOK);
}
void ExcelSchemaSoftDiscoverStrategy::DiscoverLinks()
{
    try
    {
        m_pVisitor->OnLinksBegin();

        XlLinkTable links;
        m_pReader->read(links);

        for(ChUINT4 linkIndex = 0; linkIndex < links.size(); linkIndex++)
        {
            XlLink& link = (XlLink&)links.getLink(linkIndex);
            XlExternRefEnum refType = link.getReferenceType();

            if((refType == EXTERN_REF_EXTERNAL) || (refType == EXTERN_REF_DDE_OLE))
            {
                TCHAR* type;
                if(refType == EXTERN_REF_EXTERNAL)
                    type = _T("File Link"); //"EXTERN_REF_EXTERNAL";
                else
                    type = _T("OLE Link");  //"EXTERN_REF_DDE_OLE";

                m_pVisitor->OnLink(type, static_cast<const TCHAR*>(GetString(link.getEncodedName())));
            }
        }

        m_pVisitor->OnLinksEnd();
    }
    catch(CsException const& /*e*/)
    {
        throw Workshare::Exception(_T("Binary Document Library threw an exception"));
    }
}
Example #4
0
void HubMessageControl::addMessage(const tstring& hubName, const tstring& author, const tstring& message) {
    tstring text = hubName + _T(": ");
    if (!author.empty()) {
        text += author + _T(": ");
    }
    text += message;
    const int msgHeight = MessageHeightMeasurer(this).measureHeight(text);
    messages.push_back(HubMessage());
    if (messages.size() > maxMessageCount) {
        messageHeightSum -= messages.front().height;
        messages.erase(messages.begin());
    }
    HubMessage& last = messages.back();
    last.time = Text::toT(Util::getShortTimeString());
    last.text = text;
    last.height = msgHeight;
    messageHeightSum += last.height;
    scrollTop = max(messageHeightSum - getScrollPage(), 0);
    SCROLLINFO si;
    si.cbSize = sizeof(SCROLLINFO);
    si.fMask = SIF_PAGE | SIF_POS | SIF_RANGE;
    si.nMin = 0;
    si.nMax = messageHeightSum - 1;
    si.nPage = min(messageHeightSum, getScrollPage());
    si.nPos = scrollTop;
    SetScrollInfo(SB_VERT, &si);
    Invalidate();
}
Example #5
0
void CDirectoryWatcher::BlockPath(const CTGitPath& path)
{
    blockedPath = path;
    // block the path from being watched for 4 seconds
    blockTickCount = GetTickCount64() + 4000;
    CTraceToOutputDebugString::Instance()(_T(__FUNCTION__) _T(": Blocking path: %s\n"), path.GetWinPath());
}
Example #6
0
bool WriteRegistryTreeToFile(const TCHAR *key, const TCHAR *filename)
{
    TRACE(_T("in WriteRegistryTreeToFile\n"));

    ASSERT(key && key[0] != 0);
    ASSERT(filename && filename[0] != 0);
    if (key == NULL || key[0] == 0)
        return false;
    if (filename == NULL || filename[0] == 0)
        return false;

    TRACE(_T("key=<%s>  filename=<%s>\n"), key, filename);

    TCHAR *cp = _tcschr(const_cast<LPTSTR>(key), _T('\\'));
    if (cp == NULL)
    {
        TRACE(_T("ERROR - bad registry key %s\n"), key);
        return false;
    }

    int len = cp - key;
    HKEY hKey = NULL;

#define IS_PATH(id, short_id) \
	(_tcsncmp(key, _T(#id), len) == 0 || _tcsncmp(key, _T(#short_id), len) == 0) hKey = id

    if      IS_PATH(HKEY_CLASSES_ROOT, HKCR);
    else if IS_PATH(HKEY_CURRENT_USER, HKCU);