expose Phalanger .dll as COM component ?
Posted: April 8th, 2014, 11:42 pm
Can you give a simple example of how to expose a class and member method in a Phalanger .dll to COM? I am trying to write a COM add-in for Microsoft Retail Management System which looks for a COM exposed function named "Process()"... works great in VB.net but can't get it working with Phalanger. I have tried to adapt C# examples to PHP but I am having no luck. Any help would be greatly appreciated. Sample code below:
<?php
use System;
use System\Windows\Forms;
use System\Runtime\InteropServices;
[\Export]
[assembly: System\Runtime\InteropServices\ComVisible(true)]
class RMStoPMSLibraryClass
{
function __construct(){
}
[System\Runtime\InteropServices\ComVisible(true)]
public function Process(System\Object $QSSession){
Forms\MessageBox::Show('Sample Message Box in Phalanger');
return TRUE;
}//close function process()
}//close RMStoPMSLibraryClass
?>
<?php
use System;
use System\Windows\Forms;
use System\Runtime\InteropServices;
[\Export]
[assembly: System\Runtime\InteropServices\ComVisible(true)]
class RMStoPMSLibraryClass
{
function __construct(){
}
[System\Runtime\InteropServices\ComVisible(true)]
public function Process(System\Object $QSSession){
Forms\MessageBox::Show('Sample Message Box in Phalanger');
return TRUE;
}//close function process()
}//close RMStoPMSLibraryClass
?>