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. Type mappings in the ACDKX COM How the types and interfaces of the COM word will be transated into the ACDK world. |
Content of this chapter: |
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); |
' 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 |