|
|
C_SavePanelMeshMem |
Call C_SavePanelMeshMem to save a panel mesh to memory.
void C_SavePanelMeshMem(
int PanelCount,
TPanel *lpPanels,
int Format,
void *lpHeader,
TOrcFxAPIHandle *lpBufferHandle,
int64_t *lpBufferLen,
int *lpStatus
);
The number of panels to be exported, $N$.
Points to an array of length $N$ which contains the panels to be saved.
The panel mesh file format. The only supported format is mfWamitGdf.
Points to a structure containing additional information to be written to the file alongside the panels. The type of the structure to be passed depends on the file format being used. Because WAMIT GDF is the only supported format, this parameter must be a pointer to a TWamitGdfHeader structure.
Points to a variable in which a handle to the saved buffer will be returned.
Points to a variable in which the length of the saved buffer will be returned.
Points to a variable in which the status result for the function call will be returned.
In order to extract the contents of the buffer, you must follow the call to C_SaveSpreadsheetMem with calls to C_CopyBuffer and C_FreeBuffer. Use the value returned in lpBufferLen to allocate a suitably sized buffer. Pass this to C_CopyBuffer to perform the copy. Finally, call C_FreeBuffer to free the buffer handle.
Such code typically looks like this:
TOrcFxAPIHandle BufferHandle;
int64_t BufferLen;
int Status;
C_SavePanelMeshMem(PanelCount, Panels, mfWamitGdf, &WamitGdfHeader, &BufferHandle, &BufferLen, &Status);
unsigned char *lpBuffer = new unsigned char[BufferLen];
C_CopyBuffer(BufferHandle, lpBuffer, BufferLen, &Status);
C_FreeBuffer(BufferHandle, &Status);
// use lpBuffer
delete[] lpBuffer;
Note that, for the sake of brevity, error checking has been omitted from the above code.
The Unicode function name is C_SavePanelMeshMemW and the ANSI function name is C_SavePanelMeshMemA.