Ignore:
Timestamp:
Sep 7, 1999, 9:26:19 AM (26 years ago)
Author:
davidr
Message:

Initial port of OLE2.
Added regsvr32

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ole32/oString.cpp

    r784 r851  
    9696
    9797// Initialise to a specified length...
    98 oStringA::oStringA(int defLen)   : oStringBase(sizeof(char))
     98oStringA::oStringA(int defLen, int fill)   : oStringBase(sizeof(char))
    9999{
    100100    getBuf( defLen + 1);
     
    138138}
    139139
     140oStringA::oStringA(const ULONG val)  : oStringBase(sizeof(char))
     141{
     142    getBuf( 30);        // Incl. terminator...
     143    m_strLen = sprintf(m_strBuf, "%lu", val);
     144}
     145
     146oStringA::oStringA(const LONG val)  : oStringBase(sizeof(char))
     147{
     148    getBuf( 30);        // Incl. terminator...
     149    m_strLen = sprintf(m_strBuf, "%ld", val);
     150}
     151
     152oStringA::oStringA(const USHORT val)  : oStringBase(sizeof(char))
     153{
     154    getBuf( 30);        // Incl. terminator...
     155    m_strLen = sprintf(m_strBuf, "%u", val);
     156}
     157
     158oStringA::oStringA(const SHORT val)  : oStringBase(sizeof(char))
     159{
     160    getBuf( 30);        // Incl. terminator...
     161    m_strLen = sprintf(m_strBuf, "%d", val);
     162}
     163
    140164// Return pointer to string...
    141165oStringA::operator LPSTR()
     
    193217    // Setup new string...
    194218    getBuf( 50);
    195     m_strLen  = sprintf(m_strBuf, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
    196             rClsId->Data1,
    197             rClsId->Data2,
    198             rClsId->Data3,
    199             rClsId->Data4[0],
    200             rClsId->Data4[1],
    201             rClsId->Data4[2],
    202             rClsId->Data4[3],
    203             rClsId->Data4[4],
    204             rClsId->Data4[5],
    205             rClsId->Data4[6],
    206             rClsId->Data4[7]);
     219    WINE_StringFromCLSID(rClsId, m_strBuf);
     220    m_strLen  = strlen(m_strBuf);
     221
    207222    return *this;
    208223}
     
    212227{
    213228    // two terminators to account for...
    214     oStringA    product(m_strLen + string.m_strLen - 1);
     229    oStringA    product(m_strLen + string.m_strLen - 1, 1);
    215230
    216231    memcpy(product.m_strBuf, m_strBuf, m_strLen);
     
    226241    long        strLen = m_strLen + strlen(pAscii);
    227242
    228     oStringA    product(strLen);
     243    oStringA    product(strLen, 1);
    229244
    230245    memcpy(product.m_strBuf, m_strBuf, m_strLen);
     
    240255    long        strLen = m_strLen + lstrlenW(pUnicode);
    241256
    242     oStringA    product(strLen);
     257    oStringA    product(strLen, 1);
    243258
    244259    memcpy(product.m_strBuf, m_strBuf, m_strLen);
     
    297312
    298313// Initialise to a specified length...
    299 oStringW::oStringW(int defLen) : oStringBase(sizeof(WCHAR))
     314oStringW::oStringW(int defLen, int fill) : oStringBase(sizeof(WCHAR))
    300315{
    301316    getBuf( defLen + 1);
     
    419434    // Setup new string...
    420435    getBuf( 50);
    421     m_strLen  = sprintf(tmp, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
    422             rClsId->Data1,
    423             rClsId->Data2,
    424             rClsId->Data3,
    425             rClsId->Data4[0],
    426             rClsId->Data4[1],
    427             rClsId->Data4[2],
    428             rClsId->Data4[3],
    429             rClsId->Data4[4],
    430             rClsId->Data4[5],
    431             rClsId->Data4[6],
    432             rClsId->Data4[7]);
     436    WINE_StringFromCLSID(rClsId, tmp);
     437    m_strLen  = strlen(tmp);
    433438    AsciiToUnicode(tmp, (LPWSTR)m_strBuf);
    434439    return *this;
     
    439444{
    440445    // two terminators to account for...
    441     oStringW    product(m_strLen + string.m_strLen - 1);
     446    oStringW    product(m_strLen + string.m_strLen - 1, 1);
    442447
    443448    lstrcpyW((LPWSTR)product.m_strBuf, (LPWSTR)m_strBuf);
     
    453458    long        strLen = m_strLen + strlen(pAscii);
    454459
    455     oStringW    product(strLen);
     460    oStringW    product(strLen, 1);
    456461
    457462    lstrcpyW((LPWSTR)product.m_strBuf, (LPWSTR)m_strBuf);
     
    467472    long        strLen = m_strLen + lstrlenW(pUnicode);
    468473
    469     oStringW    product(strLen);
     474    oStringW    product(strLen, 1);
    470475
    471476    lstrcpyW((LPWSTR)product.m_strBuf, (LPWSTR)m_strBuf);
     
    481486    long        strLen = m_strLen + lstrlenW((LPWSTR)pUnicode);
    482487
    483     oStringW    product(strLen);
     488    oStringW    product(strLen, 1);
    484489
    485490    lstrcpyW((LPWSTR)product.m_strBuf, (LPWSTR)m_strBuf);
Note: See TracChangeset for help on using the changeset viewer.