` Printed Icetips Article

Icetips Article



COM: When a OLE is needed and when an interface is needed
2002-12-19 -- Jim Kane
 
Newsgroups: softvelocity.products.c55ee

I looked over the code and it looks straight foward and I dont see evidence
of data types that clarion can not handle.
OleTcl, the clarion ole control both only work with latebinding and not
early binding. In other words only works with IDispatch.
To determine if this ole control is compatible, open it in ole view and look
at the interface definitions and see if they say IDispatch or IUnknown.
If it's IUnknown you MUST make interfaces and NOT use clarion ole control or
oletcl.  you are not going to get thru this com project or any other without
oleview.

assuming last binding is going to work the first few lines:
> > > Set TK = CreateObject("APToolkit.Object")
> > > r = TK.OpenOutputFile(App.Path & "\Output.pdf")
> > > r = TK.OpenInputFile(App.Path & "\Input.pdf")

translate to

if  oletcl.init('apitoolkit.object') then message('com object creation failed');return.
oletcl.callmethod('OpenOutputFile("path")')
oletcl.callmethod('OpenInputfile("path")')

if the return value of r which doesnt seem very important is important to
you then use

r = oletcl.getprop(sameasabove)

if r is an object then different syntax is required but from the code sample
I have no idea what r is.  Oleview will tell you more about its type.

Like I said, I would use an interface and not mess this all this guess work.
jim kane



Printed November 21, 2024, 6:26 am
This article has been viewed/printed 35384 times.
Google search has resulted in 109 hits on this article since January 25, 2004.