lockHost

Syntax

void* lockHost(int bufferID)

Arguments

bufferID
The ID of the memory buffer to lock.

Return

A pointer to the memory block allocated by the host application.

Description

Retrieves a pointer to a memory block allocated by the host application with the allocHost function. Since some graphics programs like Photoshop manage memory themselves, you might want to use this in preference to the C-language system memory functions like malloc.

Example

int bufferID = allocHost(100);
if (bufferID == NULL) {
  Warn("Could not allocate memory");
}
else {
  char* memptr = lockHost(bufferID);
  sprintf(memptr, "Message goes here!");
  Info(memptr);
  freeHost(bufferID);
}

See Also

allocHost, freeHost