Condividi tramite


CComCurrency::CComCurrency

Costruttore.

CComCurrency( ) throw( ); 
CComCurrency( 
   const CComCurrency& curSrc  
) throw( ); 
CComCurrency( 
   CURRENCY cySrc  
) throw( ); 
CComCurrency( 
   DECIMAL dSrc  
); 
CComCurrency( 
   ULONG ulSrc  
); 
CComCurrency( 
   USHORT usSrc  
); 
CComCurrency( 
   CHAR cSrc  
); 
CComCurrency( 
   DOUBLE dSrc  
); 
CComCurrency( 
   FLOAT fSrc  
); 
CComCurrency( 
   LONG lSrc  
); 
CComCurrency( 
   SHORT sSrc  
); 
CComCurrency( 
   BYTE bSrc  
); 
CComCurrency( 
   LONGLONG nInteger, 
   SHORT nFraction  
); 
explicit CComCurrency( 
   LPDISPATCH pDispSrc  
); 
explicit CComCurrency( 
   const VARIANT& varSrc  
); 
explicit CComCurrency( 
   LPCWSTR szSrc  
); 
explicit CComCurrency( 
   LPCSTR szSrc  
);

Parametri

  • curSrc
    Oggetto CComCurrency esistente.

  • cySrc
    Una variabile di tipo CURRENCY.

  • bSrc, dSrc, fSrc, lSrc, sSrc, ulSrc, usSrc
    Il valore iniziale assegnato a una variabile membro m_currency.

  • cSrc
    Un carattere contenente il valore iniziale assegnato a una variabile membro m_currency.

  • nInteger, nFraction
    Integer e i componenti frazionari del valore monetario iniziale. Vedere i cenni preliminari su CComCurrency per ulteriori informazioni.

  • pDispSrc
    Un puntatore IDispatch.

  • varSrc
    Una variabile di tipo VARIANT. Le impostazioni locali del thread corrente vengono utilizzate per eseguire la conversione.

  • szSrc
    Unicode o una stringa ANSI contenente il valore iniziale. Le impostazioni locali del thread corrente vengono utilizzate per eseguire la conversione.

Note

Il costruttore imposta il valore iniziale CComCurrency::m_currencye accetta una vasta gamma di tipi di dati, inclusi gli interi, stringhe, i numeri a virgola mobile, le variabili CURRENCY e altri oggetti CComCurrency. Se non viene fornito alcun valore, m_currency è impostato su 0.

In caso di errore, ad esempio un overflow, i costruttori che non dispongono di una specifica vuota di eccezione (throw()) chiamano AtlThrow con un HRESULT che descrive l'errore.

Quando si utilizza valori a virgola mobile o doppi per assegnare un valore, a CComCurrency(10.50) equivale a CComCurrency(10,5000) e non a CComCurrency(10,50).

Requisiti

Header: atlcur.h

Vedere anche

Riferimenti

CComCurrency Class