API problem for Matlab

Hi,

I am using FrontPanel 4.0.3. I copied FrontPanelUSB folder to my local work directory after installation.
When I run the following simple code SetWireInValue and/or UpdateWireIns doesn’t work.


% API test for Matlab
addpath('./Matlab');
addpath('.');
if ~libisloaded('okFrontPanel')
    loadlibrary('okFrontPanel', 'okFrontPanelDLL.h');
end 

ptr = calllib('okFrontPanel', 'okFrontPanel_Construct');
num = calllib('okFrontPanel', 'okFrontPanel_GetDeviceCount', ptr);

[mdl, nul] = calllib('okFrontPanel', 'okFrontPanel_GetDeviceListModel', ptr, 0); 
[nul, s_n] = calllib('okFrontPanel', 'okFrontPanel_GetDeviceListSerial', ptr, 0, '        ');

[err, nul, s_n] = calllib('okFrontPanel', 'okFrontPanel_OpenBySerial', ptr, strcat(s_n));
[err, nul, bit] = calllib('okFrontPanel', 'okFrontPanel_ConfigureFPGA', ptr, './First-xem5010.bit');

for i = 0:3 
    err = calllib('okFrontPanel', 'okFrontPanel_SetWireInValue', ptr, 0, 2^i, 65535);
    calllib('okFrontPanel', 'okFrontPanel_UpdateWireIns', ptr);
    pause(1);
end 

My environment as follow
OS : Windows 7
Matlab : ver 7.11, 32-bit(win32)
okFrontPanelDLL.h : $Rev: 925(2011-02-25)

there are 2 hints

  1. when loadlibrary, one of Warning is

    In loadlibrary at 458
    Warning: The data type ‘error’ used by function okFrontPanel_SetWireInValue does not exist.

  2. old version works fine with Matlab 64-bit and okFrontPanelDLL.h : $Rev 640(2009-02-26)

Configuration works fine because I verified it by Counters-XEM5010.bit
What makes me trouble?
Any Idea gives me a hope …