From: Oliver George
Subject: newby... troubles with franz/ole
Date: 
Message-ID: <2cb9b5d8.0207161447.17eb669e@posting.google.com>
Hi,

It seems like an interface returned from an ole:auto-method call are
considered IUnknown and no properties/methods are accessable on it. 
How should can I change the code below to run?

I'm new to lisp and franz but not new to coding, apologies in advance
if this is obvious.  I wanted to try and port some code to lisp, it
was a javascript file accessing the MSXML COM object.  The code is
commented in the code below.

I've looked at:

  http://www.franz.com/support/documentation/6.1/doc/ole.htm

and the examples which come with franz but they don't seem to address
this issue by virtue of being quite small examples.  (Allegro guys,
I'll gladly give you an example to add to your ole/samples just as
soon as I work out how to do it!)

thanks, Oliver.


=======================
(convert-mixed-case-symbols t)
(ole:start-ole)


; var doc = WScript.CreateObject("MSXML.DOMDocument")
(setq dom 
  (ole:ask-for-autotool "MSXML.DOMDocument" ole:CLSCTX_INPROC_SERVER))

;var xml = doc.createElement( "test" )
(setq xml 
  (ole:auto-method dom :createElement "test"))

; xml.setAttribute( "attrname", "attrvalue" )
(ole:auto-method xml :setAttribute "attrname" "attrvalue")
;;;;;;;previous line fails with "Error: no valid method"

; doc.appendChild( xml )
(ole:auto-method dom :appendChild xml)

; doc.save("c:\\oletest.xml")
(ole:auto-method dom :save "c:\\oletest.xml")


(ole:stop-ole)

From: Joe Marshall
Subject: Re: newby... troubles with franz/ole
Date: 
Message-ID: <DL5Z8.63888$uw.35332@rwcrnsc51.ops.asp.att.net>
"Oliver George" <········@utas.edu.au> wrote in message
·································@posting.google.com...
>
> ; xml.setAttribute( "attrname", "attrvalue" )
> (ole:auto-method xml :setAttribute "attrname" "attrvalue")
> ;;;;;;;previous line fails with "Error: no valid method"
>

Maybe ole:auto-getf?  (Guessing because it has been a while
since I got this working.)
From: John Wiseman
Subject: Re: newby... troubles with franz/ole
Date: 
Message-ID: <m2znwq994u.fsf@server.local.lemon>
········@utas.edu.au (Oliver George) writes:

> It seems like an interface returned from an ole:auto-method call are
> considered IUnknown and no properties/methods are accessable on it.
> How should can I change the code below to run?

It's been a while, but I think if you have a pointer that was returned
by an auto-method or auto-getf, you can use the following function to
turn it into something that you can then call auto-method and friends
on directly:

  (defun auto (xdi)
    (make-instance 'ole:remote-autotool :dispatch xdi))


John Wiseman
From: Oliver George
Subject: Re: newby... troubles with franz/ole
Date: 
Message-ID: <2cb9b5d8.0207171832.1baff8ce@posting.google.com>
>   (defun auto (xdi)
>     (make-instance 'ole:remote-autotool :dispatch xdi))

Excellent, that did the trick.  Much appreciated.

(for anyone in future reading this, this code works but I can't
guarantee it as a sensible style guide)

cya, Oliver.

===========================================
(convert-mixed-case-symbols t)
(ole:start-ole)

(defun auto (xdi)
  (make-instance 'ole:remote-autotool :dispatch xdi))

(setq dom 
  (ole:ask-for-autotool "MSXML.DOMDocument" ole:CLSCTX_INPROC_SERVER))
(setq xml 
  (ole:auto-method dom :createElement "test"))
(ole:auto-method (auto xml) :setAttribute "attrname" "attrvalue")
(ole:auto-method dom :appendChild xml)
(ole:auto-method dom :save "c:\\oletest.xml")

(ole:stop-ole)
From: Oliver George
Subject: Re: newby... troubles with franz/ole (
Date: 
Message-ID: <2cb9b5d8.0207211825.72a96fc5@posting.google.com>
Another question to which someone might have a quick answer...

   Can I access ole stuff on remote servers?

I believe this is done using the CoCreateInstanceEx call.  I can't
find any documentation which might suggest so but I'm sure someone has
wanted to before me.

cheers, Oliver.