Sample Matlab Code to call to DLL

Hi,

I use the script at the bottom to communicate with DLL and Xem7320. However, what I get is a long list of Errors or Warnings such as:

Function pointer types are unsupported in structures HRESULT ( __stdcall * FillAppend )( IFillLockBytes * .
Found on line 259173 of input from line 12934 of file C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\objidl.h

or

ERROR: extern “C” { found in file. C++ files are not supported. Use #ifdef __cplusplus to protect.
Found on line 306105 of input from line 33 of file C:\Program Files\Opal Kelly\FrontPanelUSB\API\include\okFrontPanelDLL.h

My Matlab install is R2021a x64.
Can anyone help me to fix these issues? Opal Kelly support suggests to use DES sample as a working example, which is not working either.

Thanks
Ertan

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear;

addpath(‘C:\Program Files\Opal Kelly\FrontPanelUSB\API\include’);
addpath(‘C:\Program Files\Opal Kelly\FrontPanelUSB\API\lib\x64’);
addpath(‘C:\Program Files\Opal Kelly\FrontPanelUSB\API\Matlab@okusbfrontpanel’);

% Unload existent okFrontPanel library
if libisloaded(‘okFrontPanel’)
unloadlibrary(‘okFrontPanel’);
end

% Load okFrontPanel library
if ~libisloaded(‘okFrontPanel’)
loadlibrary(‘okFrontPanel’, ‘okFrontPanelDLL.h’, ‘notempdir’);
end