|
|
|
|
|
|
ACDK COM+ provides an interface from ACDK to Windows COM and vice versa.
ACDK COM implements a DMI server and DMI client for ACDK.
With DMI it is possible to Access COM object through all
ACDK DMI clients, like C++, Java, Perl, Tcl, Python, Lisp,
CORBA and so on.
A sample using perl as DMI client to access Ms Office Word application.
sub require_class($)
{
my ($cls) = @_;
my $cl = acdk::new("acdk/lang/ClassLoader");
$cl->findClass($cls);
}
require_class('acdkx/com/ComObject');
$word = acdk::invoke_static('acdkx/com/ComObject', 'New', 'Word.Application');
$word->poke('Visible', 1);
$doc = $word->peek('Documents')->Add();
$sel = $word->peek('ActiveWindow')->peek('Selection');
$sel->TypeText("This is ");
$sel->peek('Font')->poke('Bold', 1);
$sel->TypeText("ACDK");
$sel->peek('Font')->poke('Bold', 0);
$sel->TypeText(" instrumenting Word through acdk_perl");
acdk::invoke_static('acdk/lang/Thread', 'sleep', 3000);
$word->Quit(0);
|
On the other side acdkx_com enables all COM clients access
to all DMI servers like all ACDK Objects, CORBA services,
Java classes, and so on.
Sample which just uses an ACDK Object StringBuffer.
' visual basic HelloWorld example:
Sub HelloWorld()
Dim obj As Object
Set obj = CreateObject("Acdk.Object")
Dim sb As Object
Set sb = obj.New("acdk/lang/StringBuffer", "Hallo")
sb.append " from COM"
MsgBox sb.toString()
'alternativelly also: MsgBox sb.Invoke("toString")
End Sub
|
|
|