Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4COM)  1.26.2
IModule Interface Reference

Inherits IDispatch.

Collaboration diagram for IModule:
Collaboration graph

Public Member Functions

HRESULT ActivateModule (void)
 
HRESULT DeactivateModule (void)
 
HRESULT Message ([in] BSTR text, [in] BSTR functionName, [in] LONG lineNumber)
 
HRESULT Warning ([in] BSTR text, [in] BSTR functionName, [in] LONG lineNumber)
 
HRESULT Error ([in] BSTR text, [in] BSTR functionName, [in] LONG lineNumber)
 
HRESULT Event ([in] BSTR text, [in] BSTR functionName, [in] LONG lineNumber)
 

Detailed Description

Definition of the IModule interface to access a single trace module.

Use the IModule interface to access settings of a trace module and to log messages to the trace module.

Definition at line 71 of file IModule.idl.

Member Function Documentation

HRESULT IModule::ActivateModule ( void  )

This function activates the given module. Only modules which are activated insert messages into a trace buffer. Messages, warnings or errors to modules which are deactivated are discarded.

Note
You can activate all available modules by using the method ActivateAllModules in the interface IModules.
Returns
Return value indicating success (>=0) or error (<0).
Note:
This method maps to the mlpiCore function mlpiTraceActivateModule, where you can find further documentation.
HRESULT IModule::DeactivateModule ( void  )

This function deactivates the given module. Only modules which are activated insert messages into a trace buffer. Messages, warnings or errors to modules which are deactivated are discarded.

Note
You can deactivate all available modules by using the method DeactivateAllModules in the interface IModules.
Returns
Return value indicating success (>=0) or error (<0).
Note:
This method maps to the mlpiCore function mlpiTraceDeactivateModule, where you can find further documentation.
HRESULT IModule::Message ( [in] BSTR  text,
[in] BSTR  functionName,
[in] LONG  lineNumber 
)

This function traces a message to the given module.

Parameters
[in]textUser specified description, to be shown in the trace buffer.
[in]functionNameName of source function.
[in]lineNumberLine in source file.
Returns
Return value indicating success (>=0) or error (<0).
Example C#:
try
{
connection.Trace.Modules["MLPI_TRACE_USER"].Message("This is a test message for the trace.", "SendMessage", 42);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiTraceMessage, where you can find further documentation.
HRESULT IModule::Warning ( [in] BSTR  text,
[in] BSTR  functionName,
[in] LONG  lineNumber 
)

This function traces a warning to the given module.

Parameters
[in]textUser-specified description to be shown in the trace buffer.
[in]functionNameName of source function.
[in]lineNumberLine in source file.
Returns
Return value indicating success (>=0) or error (<0).
Example C#:
try
{
connection.Trace.Modules["MLPI_TRACE_USER"].Warning("This is a test warning for the trace.", "SendWarning", 42);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiTraceWarning, where you can find further documentation.
HRESULT IModule::Error ( [in] BSTR  text,
[in] BSTR  functionName,
[in] LONG  lineNumber 
)

This function traces an error to the given module.

Parameters
[in]textUser-specified description to be shown in the trace buffer.
[in]functionNameName of source function.
[in]lineNumberLine in source file.
Returns
Return value indicating success (>=0) or error (<0).
Example C#:
try
{
connection.Trace.Modules["MLPI_TRACE_USER"].Error("This is a test error for the trace.", "SendError", 42);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiTraceError, where you can find further documentation.
HRESULT IModule::Event ( [in] BSTR  text,
[in] BSTR  functionName,
[in] LONG  lineNumber 
)

This function traces an event to the given module.

Parameters
[in]textUser-specified description to be shown in the trace buffer.
[in]functionNameName of source function.
[in]lineNumberLine in source file.
Returns
Return value indicating success (>=0) or error (<0).
Example C#:
try
{
connection.Trace.Modules["MLPI_TRACE_USER"].Event("This is a test event for the trace.", "SendEvent", 42);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiTraceEvent, where you can find further documentation.

The documentation for this interface was generated from the following file: