NERvDN Library  0.2.0.20160420-0019
NERvLibrary - Nerve Gear Developer Network
Functions and Macros

Reference for all C function and macro APIs provided by the NERvSDK. More...

template<class T >
static unsigned long NERvGear::NERvDestroy (T *&object)
 Destroy an object and nulls the pointer. More...
 
template<class T >
static unsigned long NERvGear::NERvRelease (T *&object)
 Release an object and nulls the pointer. More...
 
template<class T >
static T NERvGear::NERvMin (T a, T b)
 Computes the minimum of a and b.
 
template<class T >
static T NERvGear::NERvMax (T a, T b)
 Computes the maximum of a and b.
 
void __cdecl NERvGear::NERvLogMessage (LOG::LEVEL level, const wchar_t *tag, const wchar_t *format,...)
 Logs a message with tag at specified level. More...
 
void __cdecl NERvGear::NERvLogMessageV (LOG::LEVEL level, const wchar_t *tag, const wchar_t *format, va_list argptr)
 This is an overloaded version of NERvLogMessage(), please see its documentation for general information. More...
 
static void NERvGear::NERvLogError (const wchar_t *tag, const wchar_t *format,...)
 Logs an error message with tag. More...
 
static void NERvGear::NERvLogWarn (const wchar_t *tag, const wchar_t *format,...)
 Logs a warning message with tag. More...
 
static void NERvGear::NERvLogInfo (const wchar_t *tag, const wchar_t *format,...)
 Logs an information message with tag. More...
 
static void NERvGear::NERvLogDebug (const wchar_t *tag, const wchar_t *format,...)
 Logs a debug message with tag. More...
 
static void NERvGear::NERvLogVerbose (const wchar_t *tag, const wchar_t *format,...)
 Logs a verbose message with tag. More...
 
static long NERvGear::NERvBalloon (const wchar_t *title, const wchar_t *msg)
 Shows a balloon notification closed to the task bar icon. More...
 
static long NERvGear::NERvNotify (INotification *notify)
 Pops up an icon to notify user. More...
 
static const wchar_t * NERvGear::NERvGetModulePath ()
 Retrieves the plug-in path of current module. More...
 
static IPlugin * NERvGear::NERvPluginInstance ()
 Retrieves the plug-in instance of current module. More...
 
static long NERvGear::NERvBindEvent (IEventHandler *handler, EVT::TYPE type)
 Registers the event handler to process a type of events. More...
 
static long NERvGear::NERvUnbindEvent (IEventHandler *handler, EVT::TYPE type)
 Unregisters the event handler. More...
 
static long NERvGear::NERvProcessEvent (IEventHandler *handler, Event &event)
 Sends an event to the event handler or handlers. More...
 
static long NERvGear::NERvQueueEvent (IEventHandler *handler, Event *event)
 Post an event in the event queue of main thread. More...
 
static long NERvGear::NERvQueueTask (IRunnable *task, IEventHandler *handler, IUnknown *userdata, TASK::TYPE type)
 Queues a task to a worker thread in the thread pool. More...
 
static long NERvGear::NERvExecute (UI::IWindow *window, const wchar_t *cmd, const wchar_t *param, const wchar_t *cwd, EXEC::TYPE type, long option)
 Executes an action. More...
 
static long NERvGear::NERvCreateObject (const UID &classID, const UID &objectID, const UID &interfaceID, IUnknown *outer, void **object)
 Find and create an object instance of specified component. More...
 
static long NERvGear::NERvRegisterObject (const UID &classID, const UID &objectID, IObjectFactory *factory)
 Register an object to the component object database. More...
 
static long NERvGear::NERvUnregisterObject (const UID &classID, const UID &objectID)
 Unregister an object from the component object database. More...
 
static long NERvGear::NERvSound (const wchar_t *path, SOUND::TYPE sound)
 
static size_t NERvGear::NERvTranslation (const wchar_t *src, size_t nCharDst, wchar_t *dst)
 Finds the translation for a string and copy it to the destination buffer. More...
 
static size_t NERvGear::NERvStringLength (const wchar_t *src)
 Counts the length of a string. More...
 
static size_t NERvGear::NERvCopyCharArray (size_t nCharSrc, const wchar_t *src, size_t nCharDst, wchar_t *dst)
 Copies a char array to the destination buffer. More...
 
static size_t NERvGear::NERvCopyString (size_t nCharSrc, const wchar_t *src, size_t nCharDst, wchar_t *dst)
 Copies a null-terminated string to the destination buffer. More...
 
static size_t NERvGear::NERvCopyString (const wchar_t *src, size_t nCharDst, wchar_t *dst)
 This is an overloaded version of NERvCopyString(size_t, const wchar_t*, size_t, wchar_t*), please see its documentation for general information. More...
 
static size_t NERvGear::NERvCopyStringDoubleNull (size_t nCharSrc, const wchar_t *src, size_t nCharDst, wchar_t *dst)
 Copies a double-null-terminated string to the destination buffer. More...
 
template<size_t N_CHAR>
static size_t NERvGear::NERvCopyCharArray (const wchar_t(&src)[N_CHAR], size_t nChar, wchar_t *dst)
 This is an overloaded version of NERvCopyCharArray(size_t, const wchar_t*, size_t, wchar_t*), please see its documentation for general information. More...
 
template<size_t N_CHAR>
static size_t NERvGear::NERvCopyString (const wchar_t(&src)[N_CHAR], size_t nChar, wchar_t *dst)
 This is an overloaded version of NERvCopyString(size_t, const wchar_t*, size_t, wchar_t*), please see its documentation for general information. More...
 
template<size_t N_CHAR>
static size_t NERvGear::NERvCopyStringDoubleNull (const wchar_t(&src)[N_CHAR], size_t nChar, wchar_t *dst)
 This is an overloaded version of NERvCopyStringDoubleNull(size_t, const wchar_t*, size_t, wchar_t*), please see its documentation for general information. More...
 
VERSION __cdecl NERvGear::NERvVerCodeCore ()
 Retrieves core(NERvGear) version code. More...
 
const wchar_t *__cdecl NERvGear::NERvVerNameCore ()
 Retrieves core(NERvGear) version name string. More...
 
const wchar_t *__cdecl NERvGear::NERvGetCoreName ()
 Retrieves core(NERvGear) name string. More...
 
VERSION __cdecl NERvGear::NERvVerCodeHost ()
 Retrieves host program version code. More...
 
const wchar_t *__cdecl NERvGear::NERvVerNameHost ()
 Retrieves host program version name string. More...
 
const wchar_t *__cdecl NERvGear::NERvGetHostName ()
 Retrieves host program name string. More...
 

Detailed Description

Reference for all C function and macro APIs provided by the NERvSDK.

Macro And Flags

NVG_FLAG_INIT_UID
This macro is used to statically initialize UIDs.
#define NVG_FLAG_INIT_UID
Define NVG_FLAG_INIT_UID macro at the beginning of a source file to initialize all the UIDs declared with NVG_DEFINE_UID() macro.
When you want to create an object from another plug-in or use an interface/component not provided by NERvGear, you have to define this macro flag in the source file to initialize the object, interface and component UIDs, otherwise, your linker might not find these UID symbols.

Function Documentation

static long NERvGear::NERvBalloon ( const wchar_t *  title,
const wchar_t *  msg 
)
inlinestatic

Shows a balloon notification closed to the task bar icon.

Parameters
[in]titleThe balloon title string.
[in]msgThe balloon content string.
Return values
S_OKSuccess. The balloon has been shown.
E_FAILFailed with unknown error.
Version
0.1.0 NERv1Balloon()

Include File:

#include <NERvGear/NERv1API.h> 
static long NERvGear::NERvBindEvent ( IEventHandler handler,
EVT::TYPE  type 
)
inlinestatic

Registers the event handler to process a type of events.

Parameters
[in]handlerA pointer to the NERvGear::IEventHandler interface processing the event.
[in]typeThe event type that the event handler can processed.
Return values
S_OKSuccess, the event handler is registered successfully.
E_INVALIDARGFail, the handler is NULL, or type is NVG_ANY.
E_FAILFailed to register the event handler with unknown error.
Remarks
Registered event handlers will get notified when the responding type of event is broadcast by NERvProcessEvent() or NERvQueueEvent(). One event handler could bind the same event type multiple times, remember to call NERvUnbindEvent() with the same times and parameters to unregister all the event handlers.
Version
0.1.0 NERv1BindEvent()

Include File:

#include <NERvGear/NERv1API.h> 
static size_t NERvGear::NERvCopyCharArray ( size_t  nCharSrc,
const wchar_t *  src,
size_t  nCharDst,
wchar_t *  dst 
)
inlinestatic

Copies a char array to the destination buffer.

Parameters
[in]nCharSrcThe size of the src buffer, in characters.
[in]srcA pointer to the source char array, must not be NULL.
[in]nCharDstThe size of the dst buffer, in characters. If dst is NULL, this parameter must be 0.
[out]dstA pointer to a buffer that receives the src char array, could be NULL.
Returns
Returns the size copied into the dst buffer, in characters.
If dst is not NULL, the return value is the length of the array that is copied to the buffer, in characters. If dst buffer is too small to hold the string, the string is truncated to nCharDst characters, and the return value is nCharDst.
If dst is NULL and nCharDst is 0, the return value is nCharSrc.
If the function fails, the return value is 0.
See also
NERvCopyCharArray(const wchar_t (&)[N_CHAR], size_t, wchar_t*)

Include File:

#include <NERvGear/string.h> 
template<size_t N_CHAR>
static size_t NERvGear::NERvCopyCharArray ( const wchar_t(&)  src[N_CHAR],
size_t  nChar,
wchar_t *  dst 
)
inlinestatic

This is an overloaded version of NERvCopyCharArray(size_t, const wchar_t*, size_t, wchar_t*), please see its documentation for general information.

This version is used when you use a char array reference as the source char array.

Include File:

#include <NERvGear/string.h> 
static size_t NERvGear::NERvCopyString ( size_t  nCharSrc,
const wchar_t *  src,
size_t  nCharDst,
wchar_t *  dst 
)
inlinestatic

Copies a null-terminated string to the destination buffer.

Parameters
[in]nCharSrcThe size of the src buffer, in characters, including the null terminator.
[in]srcA pointer to the source string buffer, must not be NULL.
[in]nCharDstThe size of the dst buffer, in characters. If dst is NULL, this parameter must be 0.
[out]dstA pointer to a buffer that receives the src null-terminated string, could be NULL.
Returns
Returns the size copied into the dst buffer, in characters.
If dst is not NULL, the return value is the length of the string that is copied to the buffer, in characters, not including the terminating null character.
If dst buffer is too small to hold the string, the string is truncated to nCharDst characters including the terminating null character, and the return value is nCharDst.
If dst is NULL and nCharDst is 0, the return value is nCharSrc.
If the function fails, the return value is 0.
See also
NERvCopyString(const wchar_t*, size_t, wchar_t*), NERvCopyString(const wchar_t (&)[N_CHAR], size_t, wchar_t*)

Include File:

#include <NERvGear/string.h> 
static size_t NERvGear::NERvCopyString ( const wchar_t *  src,
size_t  nCharDst,
wchar_t *  dst 
)
inlinestatic

This is an overloaded version of NERvCopyString(size_t, const wchar_t*, size_t, wchar_t*), please see its documentation for general information.

This version is used when you don't know the length of the source string, the string's length will be counted if necessary.

Include File:

#include <NERvGear/string.h> 
template<size_t N_CHAR>
static size_t NERvGear::NERvCopyString ( const wchar_t(&)  src[N_CHAR],
size_t  nChar,
wchar_t *  dst 
)
inlinestatic

This is an overloaded version of NERvCopyString(size_t, const wchar_t*, size_t, wchar_t*), please see its documentation for general information.

This version is used when you use a null-terminated char array reference as the source string.

Include File:

#include <NERvGear/string.h> 
static size_t NERvGear::NERvCopyStringDoubleNull ( size_t  nCharSrc,
const wchar_t *  src,
size_t  nCharDst,
wchar_t *  dst 
)
inlinestatic

Copies a double-null-terminated string to the destination buffer.

Parameters
[in]nCharSrcThe size of the src buffer, in characters, including all the null terminators.
[in]srcA pointer to the source string buffer, must not be NULL.
[in]nCharDstThe size of the dst buffer, in characters. If dst is NULL, this parameter must be 0.
[out]dstA pointer to a buffer that receives the src double-null-terminated string, could be NULL.
Returns
Returns the size copied into the string buffer, in characters.
If dst is not NULL, the return value is the length of the string that is copied to the buffer, in characters, not including the terminating null characters.
If dst is NULL and len is 0, the return value is the buffer size required to store the string, in characters, including the terminating null characters.
If the function fails, the return value is 0.

Include File:

#include <NERvGear/string.h> 
template<size_t N_CHAR>
static size_t NERvGear::NERvCopyStringDoubleNull ( const wchar_t(&)  src[N_CHAR],
size_t  nChar,
wchar_t *  dst 
)
inlinestatic

This is an overloaded version of NERvCopyStringDoubleNull(size_t, const wchar_t*, size_t, wchar_t*), please see its documentation for general information.

This version is used when you use a double-null-terminated char array reference as the source string.

Include File:

#include <NERvGear/string.h> 
static long NERvGear::NERvCreateObject ( const UID classID,
const UID objectID,
const UID interfaceID,
IUnknown outer,
void **  object 
)
inlinestatic

Find and create an object instance of specified component.

Parameters
[in]classIDThe UID of a component.
[in]objectIDThe UID of a component object. If ID_NULL, system will find a default implementation for this component.
[in]interfaceIDThe UID of an interface.
[in]outerA pointer to the aggregate object's IUnknown interface (the controlling IUnknown). This parameter could be NULL, indicates that the object is not being created as part of an aggregate.
[out]objectAddress of pointer that receives the interface pointer requested in interfaceID.
Return values
S_OKSuccess. An instance of the specified component object was successfully created.
CLASS_E_NOAGGREGATIONFail. A specified object cannot be created as part of an aggregate.
E_OBJECT_NOT_FOUNDFail. A specified object is not registered in the component object database.
E_NOINTERFACEFail. A specified class does not implement the requested interface, or the controlling IUnknown does not expose the requested interface.
E_INVALIDARGFail. one or more parameters are invalid.
E_FAILFailed with unknown error.
Version
0.1.0 NERv1CreateObject()
See also
NERvRegisterObject(), NERvUnregisterObject()

Include File:

#include <NERvGear/object.h> 
template<class T >
static unsigned long NERvGear::NERvDestroy ( T *&  object)
inlinestatic

Destroy an object and nulls the pointer.

This function calls the interface's Destroy() method to destroy an object and also sets the pointer to NULL.

Todo:
Define IDestroyable.
Parameters
[in,out]objectReference of the interface pointer to the object witch supports Destroy() method.
Returns
Returns a number the Destroy() method of the interface returned, which indicates the reference count after the destroying call.
If the referenced pointer is NULL, this function do nothing and the return value is 0.
Note
Not all the interfaces support the Destroy() method, specifying an interface that does not has this method will raise compile error.
See also
NERvRelease()
static long NERvGear::NERvExecute ( UI::IWindow *  window,
const wchar_t *  cmd,
const wchar_t *  param,
const wchar_t *  cwd,
EXEC::TYPE  type,
long  option 
)
inlinestatic

Executes an action.

This function is used to open a file, URL or run a command with associated program or filter.

Parameters
[in]windowReserved, must be NULL.
[in]cmdThe action command to be executed, type determinate the meaning of this command string.
Action Type Meaning
EXEC::NONE Perform no action.
EXEC::PROGRAM Run a program, cwd is a path to the program file.
EXEC::FILE Open a file, cwd is a the path to the file.
EXEC::FOLDER Open a folder, cwd is a path to the folder.
EXEC::URL Open a URL, cwd could be a custom or a general URI string started with XXX:\ prefix.
EXEC::COMMAND Execute a command, cwd is a general command line string.
[in]paramThe parameter for command, can be NULL.
[in]cwdReserved, must be NULL.
[in]typeThe type of the action, could be one of the NERvGear::EXEC::ACTION enumeration values.
[in]optionReserved, must be 0.
Return values
S_OKSuccess, the action is executed successfully.
S_FALSESuccess, it's similar to S_OK but also indicates that the caller could 'ignore' this execution. Note that if type is NERvGear::EXEC::NONE, then the return value is also S_FALSE.
E_FAILFailed with unknown error and the action is not executed.
Remarks
This function firstly searches for the objects implementing NERvGear::CActionListener and calls all of their IExecute::Invoke() methods. Then it searches for the objects implementing NERvGear::CActionFilter and calls their IExecute::Invoke() methods, if one of these action filters returns an success code, the function stops further searching and return that code immediately. Finally, if none of the action filters could handle this action, it tries to execute this action with system associated program.
Note
The launcher menu also use this function to execute actions, action filters (NERvGear::CActionFilter implementations) that return S_FALSE will request to keep the launcher showing after executing this action.
Version
0.1.0 NERv1Execute()

Include File:

#include <NERvGear/NERv1API.h> 
const wchar_t* __cdecl NERvGear::NERvGetCoreName ( )

Retrieves core(NERvGear) name string.

e.g.

"Nerve Gear"

See also
NERvGetHostName()

Include File:

#include <NERvGear/version.h> 
const wchar_t* __cdecl NERvGear::NERvGetHostName ( )

Retrieves host program name string.

e.g. SAO Utils.exe provides

"SAO Utils"

while NERvSDK.exe provides

"NERvSDK"

See also
NERvGetHostName()

Include File:

#include <NERvGear/version.h> 
static const wchar_t* NERvGear::NERvGetModulePath ( )
inlinestatic

Retrieves the plug-in path of current module.

The returned string is generally the full path to the plug-in directory, not including the module file name. e.g.

"X:\SOME_DIRS\SAO Utils\Plugins\Plug-in Demo"

Version
0.1.0 NERv1GetModulePath()

Include File:

#include <NERvGear/NERv1API.h> 
static void NERvGear::NERvLogDebug ( const wchar_t *  tag,
const wchar_t *  format,
  ... 
)
inlinestatic

Logs a debug message with tag.

Note
This function calls NERvLogMessage() using NERvGear::LOG::DEBUG_LEVEL for convenience purposes only.

Include File:

#include <NERvGear/log.h> 
static void NERvGear::NERvLogError ( const wchar_t *  tag,
const wchar_t *  format,
  ... 
)
inlinestatic

Logs an error message with tag.

Note
This function calls NERvLogMessage() using NERvGear::LOG::ERROR_LEVEL for convenience purposes only.

Include File:

#include <NERvGear/log.h> 
static void NERvGear::NERvLogInfo ( const wchar_t *  tag,
const wchar_t *  format,
  ... 
)
inlinestatic

Logs an information message with tag.

Note
This function calls NERvLogMessage() using NERvGear::LOG::INFO_LEVEL for convenience purposes only.

Include File:

#include <NERvGear/log.h> 
void __cdecl NERvGear::NERvLogMessage ( LOG::LEVEL  level,
const wchar_t *  tag,
const wchar_t *  format,
  ... 
)

Logs a message with tag at specified level.

Takes printf() style variable argument syntax.

Parameters
[in]levelLogging level which could be one of the enumeration values of NERvGear::LOG::LEVEL.
[in]tagAn optional string pointer to the custom tag(category), could be NULL.
[in]formatA pointer to the formating string.
Remarks
Messages logged at a higher level than system logging level will be silent. The default logging level is NERvGear::LOG::INFO_LEVEL, while the 'Verbose Mode' logging level is NERvGear::LOG::VERBOSE_LEVEL. In other words, logging messages in NERvGear::LOG::DEBUG_LEVEL or NERvGear::LOG::VERBOSE_LEVEL will be filtered if 'Verbose Mode' was not turned on.
If the host program has a std output window (e.g. NERvGear.exe, does not produce log file under 'Verbose Mode'), the messages will be printed on it.
If the host program does not have any std output window (e.g. SAO Utils.exe, produces log file under 'Verbose Mode'), the messages will be invisible for users.
Note
You can also define NVG_NDEBUG macro in your project settings to strip the debug and verbose messages completely from the codes.
See also
NERvLogMessageV()

Include File:

#include <NERvGear/log.h> 
void __cdecl NERvGear::NERvLogMessageV ( LOG::LEVEL  level,
const wchar_t *  tag,
const wchar_t *  format,
va_list  argptr 
)

This is an overloaded version of NERvLogMessage(), please see its documentation for general information.

Takes vprintf() style variable argument syntax.

Include File:

#include <NERvGear/log.h> 
static void NERvGear::NERvLogVerbose ( const wchar_t *  tag,
const wchar_t *  format,
  ... 
)
inlinestatic

Logs a verbose message with tag.

Note
This function calls NERvLogMessage() using NERvGear::LOG::VERBOSE_LEVEL for convenience purposes only.

Include File:

#include <NERvGear/log.h> 
static void NERvGear::NERvLogWarn ( const wchar_t *  tag,
const wchar_t *  format,
  ... 
)
inlinestatic

Logs a warning message with tag.

Note
This function calls NERvLogMessage() using NERvGear::LOG::WARN_LEVEL for convenience purposes only.

Include File:

#include <NERvGear/log.h> 
static long NERvGear::NERvNotify ( INotification *  notify)
inlinestatic

Pops up an icon to notify user.

The notification icon keeps blinking until user click on it.

Note
This is a unpublished API while the NERvGear::INotification interface is not provided by the NERvSDK yet.
Parameters
[in]notifyA pointer to the INotification interface.
Return values
S_OKSuccess. The notification has been queued.
E_INVALIDARGThe notify is NULL.
E_FAILFailed with unknown error.
Version
0.1.0 NERv1Notify()

Include File:

#include <NERvGear/NERv1API.h> 
static IPlugin* NERvGear::NERvPluginInstance ( )
inlinestatic

Retrieves the plug-in instance of current module.

Returns
Returns an interface pointer copy of the plug-in.
If this function fails, the return value is NULL.
Remarks
The returned pointer can be converted to its original plug-in class pointer using static_cast<>() syntax.
Note
IPlugin::AddRef() was called to increase the interface's reference count before the function returns, please remember to call IPlugin::Release() when you no longer need the interface pointer.
Version
0.1.0 NERv1PluginInstance()

Include File:

#include <NERvGear/NERv1API.h> 
static long NERvGear::NERvProcessEvent ( IEventHandler handler,
Event event 
)
inlinestatic

Sends an event to the event handler or handlers.

Parameters
[in]handlerA pointer to the NERvGear::IEventHandler interface processing the event, can be NULL.
[in]eventThe event to be processed.
Returns
Returns the value that the handler's IEventHandler::HandlerEvent() method returned.
Remarks
If handler is NULL, the specified event will be broadcast to all event handlers that register to process this type of event, and the return value would be S_OK if succeed or E_FAIL if failed to broadcast this event.
If handler is not NULL, the call to this function is the same as calling a handler's IEventHandler::HandlerEvent() method directly.
Version
0.1.0 NERv1ProcessEvent()
See also
NERvQueueEvent(), NERvBindEvent()

Include File:

#include <NERvGear/NERv1API.h> 
static long NERvGear::NERvQueueEvent ( IEventHandler handler,
Event event 
)
inlinestatic

Post an event in the event queue of main thread.

This function returns without waiting for the thread to process the event.

Parameters
[in]handlerA pointer to the NERvGear::IEventHandler interface processing the event, can be NULL.
[in]eventA pointer to an event to be processed.
Return values
S_OKSuccess, the event is queued successfully.
E_INVALIDARGFail, the handler or event is NULL.
E_FAILFailed to queue the event with unknown error.
Remarks
If handler is NULL, the specified event will be broadcast to all event handlers that register to process this type of event.
If handler is not NULL, the handle will process this event.
Version
0.1.0 NERv1QueueEvent()
See also
NERvProcessEvent(), NERvBindEvent()

Include File:

#include <NERvGear/NERv1API.h> 
static long NERvGear::NERvQueueTask ( IRunnable task,
IEventHandler handler,
IUnknown userdata,
TASK::TYPE  type 
)
inlinestatic

Queues a task to a worker thread in the thread pool.

Parameters
[in]taskA pointer to the NERvGear::IRunnable interface running the task.
[in]handlerA pointer to the NERvGear::IEventHandler interface handling the task event, can be NULL.
[in]userdataA pointer to the NERvGear::IUnknown interface containing user data, can be NULL.
[in]typeThe flags that control execution, can be one or more of the NERvGear::TASK::FLAG enumeration values.
Return values
S_OKSuccess, the task is queued successfully.
E_INVALIDARGFail, the task is NULL.
E_FAILFailed to queue the task with unknown error.
Remarks
The codes of queued task will be executed in a worker thread, pleased be careful about the thread safe and locking problems.
If handler is not NULL, specified event handler will receive a NERvGear::EVT::TASKQUEUE event when the task is finished (executed or discard) in the main thread. The task event could be converted to NERvGear::TaskQueueEvent using static_cast<>() syntax, the value of its retcode is the what the IRunnable::Run() method of queued task returned.
Version
0.1.0 NERv1QueueTask()

Include File:

#include <NERvGear/NERv1API.h> 
static long NERvGear::NERvRegisterObject ( const UID classID,
const UID objectID,
IObjectFactory factory 
)
inlinestatic

Register an object to the component object database.

Todo:
Add object registration macro document.
Parameters
[in]classIDThe UID of a component.
[in]objectIDThe UID of a component object.
[in]factoryA pointer to the IObjectFactory interface of an object factory.
Return values
S_OKSuccess. The component object was successfully registered.
E_OBJECT_DUPLICATEDFail. A specified object is already registered in the component object database.
E_INVALIDARGFail. The factory is NULL.
E_FAILFailed with unknown error.
Version
0.1.0 NERv1RegisterObject()
See also
NERvUnregisterObject(), NERvCreateObject()

Include File:

#include <NERvGear/object.h> 
template<class T >
static unsigned long NERvGear::NERvRelease ( T *&  object)
inlinestatic

Release an object and nulls the pointer.

This function calls the IUnknown::Release() to release an object and also sets the pointer to NULL.

Parameters
[in,out]objectReference of the interface pointer to the object.
Returns
Returns a number the IUnknown::Release() returned, which indicates the reference count after the release call.
If the referenced pointer is NULL, this function do nothing and the return value is 0.
See also
NERvDestroy()
static long NERvGear::NERvSound ( const wchar_t *  path,
SOUND::TYPE  sound 
)
inlinestatic

Play an internal sound effect or a sound file.

Parameters
[in]pathMust be NULL currently.
[in]soundThe sound type, can be one of the enumeration values of NERvGear::SOUND::TYPE.
Return values
S_OKSuccess. The specified sound effect or file is playing asynchronously.
E_NOTIMPLThe path is not NULL.
E_FAILFailed with unknown error.
Version
0.1.0 NERv1Sound()
static size_t NERvGear::NERvStringLength ( const wchar_t *  src)
inlinestatic

Counts the length of a string.

Returns
Returns the size of src string, in characters, not including the null-terminator.
If src is NULL, the return value is 0.

Include File:

#include <NERvGear/string.h> 
static size_t NERvGear::NERvTranslation ( const wchar_t *  src,
size_t  nCharDst,
wchar_t *  dst 
)
inlinestatic

Finds the translation for a string and copy it to the destination buffer.

Todo:
Add localization document.
Remarks
If there's no translation for specified string, the src string is copied to the destination buffer.
See NERvCopyString(const wchar_t*, size_t, wchar_t*) for more details about parameters and return values.
Version
0.1.0 NERv1Translation()

Include File:

#include <NERvGear/string.h> 
static long NERvGear::NERvUnbindEvent ( IEventHandler handler,
EVT::TYPE  type 
)
inlinestatic

Unregisters the event handler.

Parameters
[in]handlerA pointer to the NERvGear::IEventHandler interface processing the event.
[in]typeThe event type that the event handler can processed.
Return values
S_OKSuccess, the event handler is registered successfully.
E_INVALIDARGFail, the handler is NULL, or type is NVG_ANY.
E_FAILFailed to register the event handler with unknown error.
Version
0.1.0 NERv1UnbindEvent()
See also
NERvBindEvent()

Include File:

#include <NERvGear/NERv1API.h> 
static long NERvGear::NERvUnregisterObject ( const UID classID,
const UID objectID 
)
inlinestatic

Unregister an object from the component object database.

Parameters
[in]classIDThe UID of a component.
[in]objectIDThe UID of a component object.
Return values
S_OKSuccess. The component object was successfully unregistered.
E_OBJECT_NOT_FOUNDFail. A specified object is not registered in the component object database.
E_FAILFailed with unknown error.
Version
0.1.0 NERv1UnregisterObject()
See also
NERvRegisterObject(), NERvCreateObject()

Include File:

#include <NERvGear/object.h> 
VERSION __cdecl NERvGear::NERvVerCodeCore ( )

Retrieves core(NERvGear) version code.

See also
NERvVerCodeHost()

Include File:

#include <NERvGear/version.h> 
VERSION __cdecl NERvGear::NERvVerCodeHost ( )

Retrieves host program version code.

See also
NERvVerCodeCore()

Include File:

#include <NERvGear/version.h> 
const wchar_t* __cdecl NERvGear::NERvVerNameCore ( )

Retrieves core(NERvGear) version name string.

e.g.

"Beta 1 x64"

See also
NERvVerNameHost()

Include File:

#include <NERvGear/version.h> 
const wchar_t* __cdecl NERvGear::NERvVerNameHost ( )

Retrieves host program version name string.

e.g. SAO Utils.exe provides

"Beta 1 x64"

while NERvSDK.exe provides

"0.1.0.0 x64"

See also
NERvVerNameCore()

Include File:

#include <NERvGear/version.h>