Completely unexpected exception: Failed to create COM object `TestCOM.generateLockPIN': Invalid syntax

659 views Asked by At

I am trying to connect a com dll which is already registered in SysWow64 using regsvr32,

$year=2017;
$month=11;
$day=15;
$msno=100;
$obj = new COM("TestCOM.generateLockPIN");  
$output=$obj->generateLockPIN($year, $month, $day, $msno); 

and also

 try {
    $obj = new COM("TestCOM");
    $year=2017;
    $month=11;
    $day=15;
    $msno=100;
 echo $output=$obj->generateLockPIN($year, $month, $day, $msno);    
} catch (Exception $e) {
    echo $e->getMessage() . "\n";
    echo 'exception initialising com object... terminating...';
}

whereas TestCOM is my dll name and generateLockPIN is function name.

I also Added permission in dcomcnfg

component services -> Properties -> Com security -> edit default -> Permissions Everyone, IUSR

and in php.ini I had set

com.allow_dcom = true

I had referred many solutions but no luck

previous questions, Tried like this

any help will be really appriciated.

0

There are 0 answers