Class

OSHandle


Description

OSHandle is used to convert a Ptr to a Integer for use with declares. For convenience, it will also accept Integers.

OSHandle is a special class in that it acts more like a keyword. See the sample code for more details.

Properties

Name

Type

Read-Only

Shared

Value

Integer

Property descriptions


OSHandle.Value

Value As Integer

The converted value.

This property is read-only.

Notes

Use this class when you need to be able to pass both Integers and pointers to the same declare.

Consider a method in your Xojo code called Foo that accepts an OSHandle as a parameter. That method could then create a declare that accepts an Integer. When you call the declare method, you could then pass it a variable of type OSHandle which could have been assigned either an Integer or a Ptr.

Sample code

To use this, declare a parameter as OSHandle:

MyMethod(handle As OSHandle)

You can then pass in either an Integer or a Ptr:

Var handle As OSHandle = 5
MyMethod(handle)

Compatibility

All project types on all supported operating systems.

See also

Object parent class; Declare keyword, Ptr data type, External Methods topic