|
AllocateMemory Method
|
|
|
Applies To
|
BasicTcl Object, AdvancedTcl Object
|
|
Prototype
|
AllocateMemory(Handle As Long, Size As Long, Flags As Long, Reserved As Long) As Long
|
|
Input
|
The "Size" parameter, which is the number of bytes to allocate.
The "Flags" parameter, which is reserved for future use and must be zero.
The "Reserved" parameter, which is reserved for future use and must be zero.
|
|
Output
|
The "Handle" parameter, which receives the new memory handle.
|
|
Returns
|
Non-zero on success or zero in case of error.
|
|
COM Results
|
S_OK: Success.
E_INVALIDARG: Either a NULL pointer was passed or the "Size" parameter is invalid. |
|
Side Effects
|
None.
|
|
Description
|
This method is a wrapper around the Tcl_Alloc function.
Memory allocated using this method MUST be freed using the FreeMemory method.
|
|
Notes
|
The block of memory returned by this function is not currently usable by any other methods of this object.
|
|
Example
|
Private Sub Command1_Click()
Dim poTcl As TclBridge.BasicTcl Dim plHandle As Long Set poTcl = New TclBridge.BasicTcl Call poTcl.AllocateMemory(plHandle, 100&, 0&, 0&) ' allocate 100 bytes Call poTcl.FreeMemory(plHandle, 0&, 0&) Set poTcl = Nothing End Sub |