Calling C++ .dll from renderer process using node ffi-napi electron

I am creating a windows application using electron. I want to call C++ .dll’s method using ffi-napi. for that I have written below code(sharing C++ and electron code). I have stuck on the “Passing_Dll.js” file which is not updating the label with id =“GenName” on click of start and stop button. I mean ces.start() or ces.stop() function is not working in “Passing_Dll.js” file.
I tried to put this line document.getElementById(‘GenName’).innerHTML = “Dummy string” after line var ffi =require(“ffi-napi”) in “Passing_Dll.js” file and realize it is not displaying even dummy string also in GUI.
but if I put same line document.getElementById(‘GenName’).innerHTML = “Dummy string” in start and stop function in “Passing_Dll.js” file before ces.start(() and ces.stop() then it is displaying the “Dummy string”.
Can somebody suggest me what I am doing wrong? why it is not executing “Passing_Dll.js” correctly. do we need to do something with main.js or something with package.json files. please suggest.
it would be much apricated if you can send a working code snippet.

dll.h

#ifdef DLL1_EXPORTS
#define DLL1_API __declspec(dllexport)
#else
#define DLL1_API __declspec(dllimport)
#endif

enum GUIENUM
{
	START = 0,
	STOP,
	DEBUG,
	STATUS,
};

typedef bool(*Callback)(bool, const char*);
extern "C" DLL1_API BOOL Connect(const char *userName, const char *password, Callback callback);

typedef void(*callbackMethod)(int statustype, const char* status);
extern "C" DLL1_API void GetCallMethod(callbackMethod callback);

extern "C" DLL1_API void Start();
extern "C" DLL1_API void Stop();

dll.cpp

#include "pch.h"
#include "framework.h"
#include "Dll1.h"
callbackMethod m_callback;

// This is an example of an exported variable
DLL1_API BOOL Connect(const char *userName, const char *password, Callback callback)
{
	callback(true, "User is connected");

	return true;
}

DLL1_API void GetCallMethod(callbackMethod callback)
{
	m_callback = callback;
	m_callback(START, "Initializaition is done");
}

DLL1_API void Start()
{
	m_callback(STATUS, "Start is pressed");
}

DLL1_API void Stop()
{
	m_callback(DEBUG, "stop is pressed");
}

index.html

<html>
 <head>
 <meta charset="UTF-8">
 <title>SIMS_R 5.2.10.2 GEN1.2 -AppFLR</title>
 </head>
 <body>
    <label for="name" id ="GenName">R 16_31_80D7_99</label><br>
    <button type="button" onclick="startFunction()" value="Display" >Start</button><br>
    <button type="button" onclick="stopFunction()" value="Display2">Stop</button><br>   
	<script src="Passing_Dll.js"></script>
 </body>
 </html>

main.js

const{BrowserWindow} =require("electron");
const app=require('electron').app;

function createWindow() {
    // Create the browser window.
   mainWindow = new BrowserWindow({width:600, height: 650});
  
   // Disable menu
   mainWindow.setMenu(null)
    
   // and load the index.html of the app.
   mainWindow.loadURL('file://'+__dirname+'/index.html')
}
app.on('ready',createWindow);

Passing_Dll.js

var ffi =require("ffi-napi");
var ref =require("ref-napi");
var Enum = require('enum')
var constString = ref.types.CString;
var bool = ref.types.bool;
var int = ref.types.int;
var enumCallback = new Enum({  'START': 0,
  'STOP': 1,
  'DEBUG': 2,
  'STATUS': 3
}); 

var callback = ffi.Callback(bool, [bool, constString], function (sec, data) {
    console.log(sec)
    console.log(data);
  
  });

var callback2 =ffi.Callback(ref.types.void, [int, constString], function (sec, data) {
	switch(sec)
	{
	  case enumCallback.START.value: 
	   console.log(sec);
	   console.log(data);
	   document.getElementById('GenName').innerHTML = data;
	   break;
	   case enumCallback.STOP.value: 
	   console.log(sec);
	   console.log(data);
	   document.getElementById('GenName').innerHTML = data;
	   break;
	   case enumCallback.STATUS.value: 
	   console.log(sec);
	   console.log(data);
	   document.getElementById('GenName').innerHTML = data;
	   break;
	   case enumCallback.DEBUG.value: 
	   console.log(sec);
	   console.log(data);
       document.getElementById('GenName').innerHTML = data
	   break;
	   default:
		console.log(sec);
		console.log(data);
		document.getElementById('GenName').innerHTML = data
		break;
	}
});

var libloc = "./Dll1.dll";
  
const ces = ffi.Library(libloc, {
  'Connect': [bool, [constString, constString, 'pointer']],
  'GetCallMethod':[ref.types.void, ['pointer']],
  'Start': [ref.types.void,[ ]],
  'Stop': [ref.types.void,[ ]],
  
});

module.exports = ces;

var maxLength = 200;
var nameBuffer1 = Buffer.alloc(maxLength);
nameBuffer1.fill(0); 
nameBuffer1.write("user", 0, "utf-8"); 


var nameBuffer2 = Buffer.alloc(maxLength);
nameBuffer2.fill(0); 
nameBuffer2.write("password", 0, "utf-8");

ces.Connect(nameBuffer1,nameBuffer2,callback)
ces.GetCallMethod(callback2)
  
function startFunction()
{
	ces.Start()
}
  
function stopFunction()
{
	ces.Stop()
}