| MIL 10 Reference
| Customize Help
| Save Settings

McodeAlloc



See also
Availability
Not available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
Previous
Synopsis
Allocate a code context.
Syntax
MIL_ID McodeAlloc(
MIL_ID SysId, //in
MIL_INT64 ContextType, //in
MIL_INT64 ControlFlag, //in
MIL_ID *ContextCodeIdPtr //out
)
Description

This function allocates a code context. The code context contains the models of the codes to read, verify, or write.

To add code models to the context, use McodeModel(). A code context can contain multiple 1D code models of various types (excluding GS1 databar, Planet, and Postnet), but for 2D code types, a context can contain at most one model. To adjust code model settings, use McodeControl().

When the code context is no longer needed, you should free it, using McodeFree().

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
SysId INQ

Specifies the system on which to allocate the context. This parameter should be set to one of the following values:

function map For specifying the system
CollapseValue Description
Collapse M_DEFAULT_HOST

Specifies the default Host system of the current MIL application.

Collapse MIL system identifier

Specifies a valid system identifier, previously allocated using MsysAlloc().

ContextType

Specifies the context type. Reserved for future expansion. This parameter must be set to M_DEFAULT.

ControlFlag

Specifies the function's control flag. Reserved for future expansion. This parameter must be set to M_DEFAULT.

ContextCodeIdPtr

Specifies the address in which to return the identifier of the code context. Since this function also returns the identifier, this parameter can be set to M_NULL.

Return value
The returned value is the code context identifier if the allocation is successful. If allocation fails, M_NULL is returned.
Compilation information
Header Include mil.h.
Library Use mil.lib; milcode.lib.
DLL Requires mil.dll; milcode.dll.
DEFAULT HOST