- Alert
- CheckPointer
- Comment
- CryptEncode
- CryptDecode
- DebugBreak
- ExpertRemove
- GetPointer
- GetTickCount
- GetTickCount64
- GetMicrosecondCount
- MessageBox
- PeriodSeconds
- PlaySound
- PrintFormat
- ResetLastError
- ResourceCreate
- ResourceFree
- ResourceReadImage
- ResourceSave
- SetReturnError
- SetUserError
- Sleep
- TerminalClose
- TesterHideIndicators
- TesterStatistics
- TesterStop
- TesterDeposit
- TesterWithdrawal
- TranslateKey
- ZeroMemory
GetPointer
La funzione restituisce l'oggetto pointer.
void* GetPointer(
|
Parametri
anyobject
[in] Oggetto di qualsiasi classe.
Valore restituito
La funzione restituisce il puntatore all'oggetto.
Nota
Solo gli oggetti della classe hanno puntatori. Le istanze delle strutture e variabili di tipo semplice non possono avere puntatori. L'oggetto della classe creato non usando l'operatore new(), ma, ad esempio, creato automaticamente nell'array di oggetti, ha ancora un puntatore. Ma questo puntatore sarà di tipo automatico POINTER_AUTOMATIC, pertanto l'operatore delete() non può essere applicato. A parte questo, il puntatore tipo non differisce da puntatori dinamici di tipo POINTER_DYNAMIC.
Poiché le variabili di tipo strutture e di tipo semplice non sono puntatori, è vietato applicare la funzione GetPointer() per esse. E' anche vietato passare il puntatore come argomento di funzione. In tutti questi casi il compilatore notificherà un errore.
Un tentativo di chiamare un puntatore errato provoca la terminazione critica del programma. Ecco perché la funzione CheckPointer() deve essere chiamata prima di utilizzare un puntatore. Un puntatore può essere corretto nei seguenti casi:
Questa funzione può essere utilizzata per verificare la validità di un puntatore. Un valore non-zero garantisce, che il puntatore può essere utilizzato per accedere.
Esempio:
//+--------------------------------------------------------------------------------+
|
Vedi anche
Object Pointers, Checking the Object Pointer, Object Delete Operator delete