- 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
The function returns the object pointer.
void* GetPointer(
|
Parameters
anyobject
[in] Object of any class.
Return Value
The function returns the object pointer.
Note
Only class objects have pointers. Instances of structures and simple-type variables can't have pointers. The class object not created using the new() operator, but, e.g., automatically created in the array of objects, still has a pointer. But this pointer will be of the automatic type POINTER_AUTOMATIC, therefore the delete() operator can't be applied to it. Aside from that, the type pointer doesn't differ from dynamic pointers of the POINTER_DYNAMIC type.
Since variables of structure types and simple types do not have pointers, it's prohibited to apply the GetPointer() function to them. It's also prohibited to pass the pointer as a function argument. In all these cases the compiler will notify an error.
An attempt to call an incorrect pointer causes the critical termination of a program. That's why the CheckPointer() function should be called prior to using a pointer. A pointer can be incorrect in the following cases:
This function can be used to check the validity of a pointer. A non-zero value guarantees, that the pointer can be used for accessing.
Example:
//+------------------------------------------------------------------+
|
See also
Object Pointers, Checking the Object Pointer, Object Delete Operator delete