Reply to Re: COM Objects

Your name:

Reply:


Posted by Steve on 04/25/07 14:13

| > | The interfaces are not something php would understand.
| >
| > actually, the interfaces are com...so php can understand them.
|
| Hmmm!!! that's very interesting :)
| I had no idea whatsoever. Must look into that further.

just depends on how you compile it (exe, dll, ocx, etc.)

| > i doubt he's heard of atl's or any other kind of template library. i can
| > hear the 'huh?' from here.
|
| Yes, that is hardly helpful now that you mention it.

no, it's good advice. if the op isn't lazy and can google, there are free
tools on the net that will build atl's for you without you even having
development software installed on your machine. that would probably work
just fine.

| > | Visual basic is com so the complexity is hidden from you
| >
| > since it does abide by the com contract, all he'd have to do for a
wrapper
| > would be to create a form, drop the control on it, then expose it's
| > interfaces publically, and compile his new dll. php can consume the
| > interfaces from there.
| A form?? That did confuse me when I read it. Where would I look into
this
| Steve?

i'm not sure i know of a resource anymore. i think mvps.org is still out
there.

anyway, all you have to do is create a project with a public class object, a
form with the control on it, implement the mscomm control's interfaces
(literally, using 'implements')...when someone creates an instance of your
class, your class loads the form. when they call a method or set/get a
property of your class, you call/set/get the control's corresponding one.

say your form is form1 and it's com control is mscomm1. your class would do:

======================

'this is your com control var

private comControl as mscomcontrol ' i can't remember how it shows
' when the project has a ref to it
' but you get the idea

'interface declaration

implements mscomcontrol

'set the control var to the control instance
'this is in the class' initialize()

set comControl = form1.mscomm1

'this is after the class initializes
'and someone calls open()

public function open(byval strSettings as string) implements
mscomcontrol.open
comControl.open(strSettings)
end function

====================

that's all pseudo-code, but it's pretty close to the real-deal. if you
compile this as a dll, life is good and the problem is solved.

cheers.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация