POV-Ray : Newsgroups : povray.off-topic : The other OS : Re: The other OS Server Time
30 Jul 2024 10:21:30 EDT (-0400)
  Re: The other OS  
From: Darren New
Date: 5 Aug 2011 16:01:23
Message: <4e3c4c13$1@news.povray.org>
On 8/5/2011 5:42, Orchid XP v8 wrote:
> I was asking, more basically, "how do you do useful stuff with
> COM?"

Oh. You find a COM object that does what you want it to do, and you use it.

> As best as I can tell, COM lets you create "objects" and invoke
> "methods" on them... that's as far as I was able to figure out.

Yes, that's what COM is for. The "methods" are usually implemented in either 
system libraries or in applications. So an "object" might be an excel 
spreadsheet, and the "methods" would manipulate the cells, set up a graph, 
and then copy the image of the graph to the clipboard for you to use.

Asking "what good is COM" is like asking "what good are command line 
arguments? All they do is let you give strings to a program, but what do I 
*use* them for?"

With COM, you could do something like write a script that reads a database, 
sticks the entries in Excel, does a time-value average, finds the entry that 
has some maximum value for some property you're interested in, and then fire 
up google earth to plot how that property has changed with geography over time.

COM is to stdio like powershell is to CLI. It's an OO way of talking to a 
running program and invoking methods inside it.

> I'm fairly sure I tried that [or similar] in Tcl and it didn't work.

I dunno. I used it for years.

> I also figured that the only reason that you can (say) embed an Excel
> spreadsheet in a Word document is because both products are produced by the
> same company.

No no no. That's the whole *point* of COM. That's why there's a standard 
interface definition language and such. That's how systems like firefox and 
emacs work - custom scripting languages manipulating data structures only 
visible within the context of that program. COM lets you talk to the data 
structures inside a program without using that program's scripting language.

> I've yet to see a language that can invoke DLLs either...

Maybe you should learn a normal language, then. :-)

> I'd be perfectly happy doing COM from, say, JavaScript. It's not that
> Haskell is the problem, it's that I can't see *anything* that speaks COM.

Tcl, VBScript, WScript, VBA, and C# all have trivial interfaces to COM. 
Google up some language you know, and look to see if it has a COM interface 
implementation.  Didn't you tell me you had written a VBA macro or two?

> I get the feeling that the only way to solve this is to use some
> horrifically awful language like VB...

No, you just have to learn something vaguely normal, and then not give up 
when the first thing you try doesn't work.

-- 
Darren New, San Diego CA, USA (PST)
   How come I never get only one kudo?


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.