acdkx_com Manual


ACDK COM+ provides an interface from ACDK to Windows COM and vice versa.

Sub chapter pages:

To use ACDK Objects from COM the COM server has to be registered.

ACDK COM+ provides an interface from ACDK to Windows COM and vice versa.

ACDK COM+ provides an interface from ACDK COM+ Clients to ACDK Objects.

How the types and interfaces of the COM word will be transated into the ACDK world.

Content of this chapter:

     COM as generic DMI server
     COM as generic DMI client


ACDK COM implements a DMI server and DMI client for ACDK.

 COM as generic DMI server

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");

$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->peek('Font')->poke('Bold', 0);
$sel->TypeText(" instrumenting Word through acdk_perl");
acdk::invoke_static('acdk/lang/Thread', 'sleep', 3000);

 COM as generic DMI client

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