Calling DLL function in PHP
Posted: Thu Oct 13, 2011 9:56 pm
Hi guys; Need help for this one. Please correct my codes.
form.php:
cardMaker.php:
When I try to call the ReadMessage it says (unable to call ReadMessage) how to call this one?
Thanks;
carl_bugs
form.php:
Code: Select all
<?php
require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR.'cardMaker.php');
$ehorsCardMaker = new cardMaker();
$ehorsCardMaker->ReadMessage(1, 4, 1, int* DBCardno, int* DBCardtype, int* DBPassLevel, 'FFFFFFFFFFFF', char* DBSystemcode,char* DBAddress,char* SDateTime, 1);
?>Code: Select all
<?php
if (!extension_loaded('ffi')) {
die("Please install FFI extension.");
}
class cardMaker extends ffi {
function __construct() {
parent::__construct(<<<EOD
[lib='HUNERF.dll']
EXTERN_API int WINAPI ReadMessage(int Com ,int nBlock,int Encrypt,int* DBCardno,int* DBCardtype,int* DBPassLevel,
char* CardPass,char* DBSystemcode,char* DBAddress, char* SDateTime);
EOD
);
}
}
?>When I try to call the ReadMessage it says (unable to call ReadMessage) how to call this one?
Thanks;
carl_bugs