Calling DLL function in PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
carl_bugs
Forum Newbie
Posts: 1
Joined: Thu Oct 13, 2011 9:45 pm

Calling DLL function in PHP

Post by carl_bugs »

Hi guys; Need help for this one. Please correct my codes.

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);
?>
cardMaker.php:

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
Last edited by Benjamin on Thu Oct 13, 2011 10:43 pm, edited 1 time in total.
Reason: Added [syntax=php|sql|css|javascript] and/or [text] tags.
Post Reply