You are here: Re: Trouble embedding ActiveX object in HTML using object tag « HTML « IT news, forums, messages
Re: Trouble embedding ActiveX object in HTML using object tag

Posted by rf on 11/30/05 01:44

Mark Parnell wrote:

> In our last episode, Chris Lieb <chris.lieb@gmail.com> pronounced to
> alt.html:

>> As far as I know,
>> only ActiveX can read data straight out of a COM port,
>
> I couldn't advise on that. I have a suspicion that Richard (rf) could
> though if he's around...Richard? Richard? RICHARD?
>
> Damn, he must have had too much rum&coke again.

W Wh What?, Where?. Why?

Crikey guys, could you keep the noise down to a dull roar. I'm trying to
sleep here. Oh, Is that the time?
<yawn/><scratch/><coffee/>

Er, a com port is, as far as whoever is using it is concerened, merely part
of the file system. (In C for example one opens a "com" file like this:
hCommPort = CreateFile("COM1", GENERIC_READ | GENERIC_WRITE, ...), same as
any other file)

There are a few extra dodads involved but basically if something can read a
local file (VBasic and JScript with the right settings) then one can read a
com port. Of course there is an advantage if one can do it asynchronously
(FILE_FLAG_OVERLAPPED in the above CreateFile), otherwise you have to
<shudder/> poll, but this _can_ be done.

I don't do Java so cannot comment on the sandbox status of local file I/O.

Chris, have you explored .hta (HTML Applications)? For an intranet maybe
you can do it there? An hta *does* have access to the local file system and
there are no messy controls to fiddle with.


Regarding ActiveX and straight from MSDN:
<quote>
If you can imagine it, you can do it with an ActiveX control.
</quote>

So, yes, an ActiveX control can read data straight out of a COM port, but
we know this. I would presume that it would have to write data into that
port as well.

But, further, an ActiveX control, being a COM object (as in Component
Object Model), has access to the *full* windows API. That means it can do
absolutely anything any other program can. Yep, anything at all, up to and
including removing the entire contents of your hard disk, including most of
your operating system and then rebooting your computer for you, after
swapping your mouse buttons round.

That's why I do not allow them to run.

>> so my use of
>> ActiveX should not cause any problems.

*Your* ActiveX control may not cause *you* any problems but you can not
ensure that *my* ActiveX control will not cause you problems :-)

I don't know you so I can not confirm that *your* control will not cause
*me* problems, so I won't run it.

Of course in an intranet scenario most of the rules change. Make your
"users" install your control by all means but do not allow them to install
wild controls found out there on the web.

> For now.

Indeed.

--
Cheers, Richard.

 

Navigation:

[Reply to this 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

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