UseDoubleAsPointer (NotesSession - LotusScript )

Allows you to use a Double to handle a 64-bit pointer argument for a C API call.

Define in

NotesSession

Syntax

callnotesSession.UseDoubleAsPointer=True

True, Double is treated as pointer. False, Double assumes normal Double behavior.

Usage

LotusScript does not have a pointer type so it can encounter issues when a LotusScript agent is used to call C API 64-bit pointers. The UseDoubleAsPointer method, introduced in HCL Domino 12.0.1, provides a workaround for this limitation by allowing Double to handle a C API 64-bit pointer argument. Note that Long has sometimes been used for pointers but is now too small to carry a C pointer.

This workaround was previously available through the Domino notes.ini setting LS64BITCCALLOUTPointerSupport=1. However, the notes.ini approach had the downside of applying to all LotusScript agents on the server.

UseDoubleAsPointer requires at least a Domino Designer 12.0.1 client for the LotusScript coding and at least a Domino 12.0.1 server to run the LotusScript agent.
Note: The Notes client runs under a single backend session. If any script sets the value to True, after the C API callout, reset the value to false so that subsequent scripts use the correct Double behavior.

Example

Start and then stop using the UseDoubleAsPointer method (parts removed for brevity):
session.UseDoubleAsPointer = True


	Print "Calling OSMemAlloc with size, setting  active", dwDWordOne
	wWordOne = OSMemAlloc(wWordTwo, dwDWordOne, dwDWordTwo)
	
	If(wWordOne = 0) Then
		Print "OSMemAlloc worked, continuing with handle", dwDWordTwo
		dRetDouble = OSLockObject(dwDWordTwo)
		If(dRetDouble > 0) Then
			Print "OSLockObject worked, calling XXX"
...
			OSUnlockObject(dwDWordTwo)
		Else
			Print "OSLockObject failed"
		End If
		Print "Freeing memory"
		wWordOne = OSMemFree(dwDWordTwo)
	End If

session.UseDoubleAsPointer = False