For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/api/lynx-native-api/lynx-extension-module/set-c-module.md.
Lynx
  • English
  • SetCModule

    The SetCModule method is responsible for initializing the LynxExtensionModule by associating it with its underlying C-API counterpart, lynx_extension_module_t. This is a crucial setup step that must be performed to enable the C++ wrapper's functionality.

    Calling this method also triggers BindFunction(), which connects the C++ virtual methods (like OnLynxViewCreate, OnRuntimeInit, etc.) to the C-API's callback mechanism.

    Method Signature

    void SetCModule(lynx_extension_module_t* c_module);

    Parameters

    NameTypeDescriptionRequired
    c_modulelynx_extension_module_t*A pointer to the C-API lynx_extension_module_t instance.Yes

    Usage

    The host integration must call this method immediately after creating the lynx_extension_module_t instance. Call it before using other wrapper methods, including SetNapiModuleCreator, and before returning the C module to Lynx. This binding allows your custom C++ LynxExtensionModule subclass to receive lifecycle events from the core Lynx engine.

    Compatibility

    LCD tables only load in the browser

    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.