UltraLite for MobileVB User's Guide
UltraLite for MobileVB API Reference
ULConnection class
StringToUUID(
s_uuid As String, _
buffer_16_bytes As Long _
)
Member of UltraLiteAFLib.ULConnection
Converts the universally unique identifier represented as a String in the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx to a Byte array of 16 bytes. In a MobileVB application, it may be useful to refer to them in their string format. Consequently, the UUIDValue property on the ULColumn object converts from string to binary(16) and vice versa. The StringToUUID function is provided as an easy way to convert a MobileVB String to a Byte array. It does not reference the UltraLite database in any way.
A note on the pointer to the buffer:The pointer to the buffer must be declared as at least16 bytes. Since Visual Basic does not provide bounds checking, memory could be overwritten if the buffer is too small. Use the VarPtr() function to get the pointer to the buffer. See also ULColumn.UUIDValue property |
s_uuid A Universally Unique Identifier passed in as a string. You can obtain a new string UUID using GetNewUUID.
buffer_16_bytes A pointer to a byte array that has at least 16 elements. Use the VarPtr() function to get the pointer value.
The following example will convert the string form of the UUID 0a141e28-323c-4650-5a64-6e78828c96a0 to a binary array:
Dim buff(1 to 16) As Byte conn.StringToUUID( "0a141e28-323c-4650-5a64-6e78828c96a0", VarPtr(buff(1)) )