Trouble embedding ActiveX object in HTML using object tag

Discussion in 'HTML' started by Chris Lieb, Nov 28, 2005.

  1. Chris Lieb

    Chris Lieb Guest

    Hi,

    I am trying to embed an ActiveX control that handles barcode scanner
    input in a HTML page. It works fine on the computer that I developed
    the control on since VB automatically registers ActiveX controls when
    it builds them. However, when I try to open the page on another
    computer, instead of the control, I get a standard IE placeholder.
    Here is the code that I am using:

    <object
    name="barcodeTest"
    classid="clsid:C9575896-B228-4B1C-A854-6B0DA7F9BFD9"
    codebase="http://ilhodsvr02b6/development/phh5cjl/apps/inventory/activex/barcodegetter.cab"
    standby="Loading..."
    type="application/x-oleobject"
    width="350"
    height="25">
    <param name="value" value="param" />
    </object>

    The path in the codebase is correct because I tried copying and pasting
    it into a browser and it tried to download it. I am assuming that the
    CLSID is correct because the control displays properly on my
    development machine. I tried setting the codebase to point to the OCX
    and also appending a #version=1,0,0,0 to both the CAB and OCX paths
    (the file is version 1.0.0.0), but this caused no change.

    Does anyone know what is going on? This is really bugging me since it
    looks like everything is correct and inline with many examples that I
    have found on the web.

    You help is much appreciated

    Chris Lieb
    Chris Lieb, Nov 28, 2005
    #1
    1. Advertising

  2. Chris Lieb

    Guest

    Chris Lieb wrote:
    > Hi,
    >
    > I am trying to embed an ActiveX control that handles barcode scanner
    > input in a HTML page. It works fine on the computer that I developed
    > the control on since VB automatically registers ActiveX controls when
    > it builds them. However, when I try to open the page on another
    > computer, instead of the control, I get a standard IE placeholder.
    > Here is the code that I am using:
    >
    > <object
    > name="barcodeTest"
    > classid="clsid:C9575896-B228-4B1C-A854-6B0DA7F9BFD9"
    > codebase="http://ilhodsvr02b6/development/phh5cjl/apps/inventory/activex/barcodegetter.cab"
    > standby="Loading..."
    > type="application/x-oleobject"
    > width="350"
    > height="25">
    > <param name="value" value="param" />
    > </object>
    >
    > The path in the codebase is correct because I tried copying and pasting
    > it into a browser and it tried to download it. I am assuming that the
    > CLSID is correct because the control displays properly on my
    > development machine. I tried setting the codebase to point to the OCX
    > and also appending a #version=1,0,0,0 to both the CAB and OCX paths
    > (the file is version 1.0.0.0), but this caused no change.
    >
    > Does anyone know what is going on? This is really bugging me since it
    > looks like everything is correct and inline with many examples that I
    > have found on the web.


    I am not certain what is going on, from what you gave. Is it possible
    that ActiveX is turned off for the second computer? If I remember
    correctly, when you upgraded to SP2, ActiveX and some other hacker
    favorites had to be enabled if you wanted the browser to use them. Your
    wording seems to indicate that the second computer is using an IE
    browser which should handle AX. However most other browsers will not
    handle ActiveX at all or require a special plugin to do so. I have no
    experience with barcodes. However, in many other cases where an ActiveX
    object is used, an ordinary object can be found that will do the same
    thing. If not, many include an embed within the AX object for browsers
    that will not handle AX. This approach is bad html, but it seems to
    work for many browsers that can not handle AX.
    , Nov 28, 2005
    #2
    1. Advertising

  3. Chris Lieb

    Chris Lieb Guest

    wrote:
    > Chris Lieb wrote:
    > > Hi,
    > >
    > > I am trying to embed an ActiveX control that handles barcode scanner
    > > input in a HTML page. It works fine on the computer that I developed
    > > the control on since VB automatically registers ActiveX controls when
    > > it builds them. However, when I try to open the page on another
    > > computer, instead of the control, I get a standard IE placeholder.
    > > Here is the code that I am using:
    > >
    > > <object
    > > name="barcodeTest"
    > > classid="clsid:C9575896-B228-4B1C-A854-6B0DA7F9BFD9"
    > > codebase="http://ilhodsvr02b6/development/phh5cjl/apps/inventory/activex/barcodegetter.cab"
    > > standby="Loading..."
    > > type="application/x-oleobject"
    > > width="350"
    > > height="25">
    > > <param name="value" value="param" />
    > > </object>
    > >
    > > The path in the codebase is correct because I tried copying and pasting
    > > it into a browser and it tried to download it. I am assuming that the
    > > CLSID is correct because the control displays properly on my
    > > development machine. I tried setting the codebase to point to the OCX
    > > and also appending a #version=1,0,0,0 to both the CAB and OCX paths
    > > (the file is version 1.0.0.0), but this caused no change.
    > >
    > > Does anyone know what is going on? This is really bugging me since it
    > > looks like everything is correct and inline with many examples that I
    > > have found on the web.


    > I am not certain what is going on, from what you gave. Is it possible
    > that ActiveX is turned off for the second computer?


    For the computers on our intranet, IE is set to allow all ActiveX
    controls.

    > If I remember correctly, when you upgraded to SP2, ActiveX and some other hacker
    > favorites had to be enabled if you wanted the browser to use them. Your
    > wording seems to indicate that the second computer is using an IE
    > browser which should handle AX. However most other browsers will not
    > handle ActiveX at all or require a special plugin to do so.


    All of the computers that this will run on are Win2k Pro SP4 machines
    with IE6 SP1 installed. All of the machines are produced from the same
    corporate build, so if it works on my machine, it should work on all of
    them.

    > I have no experience with barcodes. However, in many other cases where an ActiveX
    > object is used, an ordinary object can be found that will do the same thing.


    All my ActiveX control had to do was read the character data that the
    scanner sent through the serial or keyboard PS/2 port. All of the
    barcode recognition is handled within the scanner. As far as I know,
    only ActiveX can read data straight out of a COM port, so that is the
    route that I have been inclined to take. The only other possibility
    that I can think of is client-side Java, but I assume that since it is
    running in a sandbox it cannot access the COM ports. (That, and I
    know how to easily handle the task in VB6, but I have never done
    anything of the sort in Java.)

    > If not, many include an embed within the AX object for browsers
    > that will not handle AX. This approach is bad html, but it seems to
    > work for many browsers that can not handle AX.


    I won't have to support any browsers other than IE6, so my use of
    ActiveX should not cause any problems. From what I see on the web and
    have experienced, using the object tag should work just as well as
    using the embed tag in IE6, so I would prefer to use the standards
    compliant way if at all possible.

    Chris Lieb
    Chris Lieb, Nov 29, 2005
    #3
  4. Chris Lieb

    Chris Lieb Guest

    Chris Lieb wrote:
    > Hi,
    >
    > I am trying to embed an ActiveX control that handles barcode scanner
    > input in a HTML page. It works fine on the computer that I developed
    > the control on since VB automatically registers ActiveX controls when
    > it builds them. However, when I try to open the page on another
    > computer, instead of the control, I get a standard IE placeholder.
    > Here is the code that I am using:
    >
    > <object
    > name="barcodeTest"
    > classid="clsid:C9575896-B228-4B1C-A854-6B0DA7F9BFD9"
    > codebase="http://ilhodsvr02b6/development/phh5cjl/apps/inventory/activex/barcodegetter.cab"
    > standby="Loading..."
    > type="application/x-oleobject"
    > width="350"
    > height="25">
    > <param name="value" value="param" />
    > </object>
    >
    > The path in the codebase is correct because I tried copying and pasting
    > it into a browser and it tried to download it. I am assuming that the
    > CLSID is correct because the control displays properly on my
    > development machine. I tried setting the codebase to point to the OCX
    > and also appending a #version=1,0,0,0 to both the CAB and OCX paths
    > (the file is version 1.0.0.0), but this caused no change.
    >
    > Does anyone know what is going on? This is really bugging me since it
    > looks like everything is correct and inline with many examples that I
    > have found on the web.
    >
    > You help is much appreciated
    >
    > Chris Lieb


    After testing on yet another machine, I realized that I was not
    distributing all of the DLLs required to run my ActiveX control. I
    have now used the VB6 Package and Deployment Wizard to make sure that
    all of the run-time dependancies for my ActiveX control are included in
    the CAB that I have on the web server. The wizard also generates a
    bare-bones HTML page that gives an object tag for the control. This
    page works on my computer, but just gives me a placeholder on the other
    computers that I have tested it on. All I can say is that I am only
    becoming more stumped as time goes by.

    Chris Lieb
    Chris Lieb, Nov 29, 2005
    #4
  5. Chris Lieb

    Chris Lieb Guest

    Chris Lieb wrote:
    > Chris Lieb wrote:
    > > Hi,
    > >
    > > I am trying to embed an ActiveX control that handles barcode scanner
    > > input in a HTML page. It works fine on the computer that I developed
    > > the control on since VB automatically registers ActiveX controls when
    > > it builds them. However, when I try to open the page on another
    > > computer, instead of the control, I get a standard IE placeholder.
    > > Here is the code that I am using:
    > >
    > > <object
    > > name="barcodeTest"
    > > classid="clsid:C9575896-B228-4B1C-A854-6B0DA7F9BFD9"
    > > codebase="http://ilhodsvr02b6/development/phh5cjl/apps/inventory/activex/barcodegetter.cab"
    > > standby="Loading..."
    > > type="application/x-oleobject"
    > > width="350"
    > > height="25">
    > > <param name="value" value="param" />
    > > </object>
    > >
    > > The path in the codebase is correct because I tried copying and pasting
    > > it into a browser and it tried to download it. I am assuming that the
    > > CLSID is correct because the control displays properly on my
    > > development machine. I tried setting the codebase to point to the OCX
    > > and also appending a #version=1,0,0,0 to both the CAB and OCX paths
    > > (the file is version 1.0.0.0), but this caused no change.
    > >
    > > Does anyone know what is going on? This is really bugging me since it
    > > looks like everything is correct and inline with many examples that I
    > > have found on the web.
    > >
    > > You help is much appreciated
    > >
    > > Chris Lieb

    >
    > After testing on yet another machine, I realized that I was not
    > distributing all of the DLLs required to run my ActiveX control. I
    > have now used the VB6 Package and Deployment Wizard to make sure that
    > all of the run-time dependancies for my ActiveX control are included in
    > the CAB that I have on the web server. The wizard also generates a
    > bare-bones HTML page that gives an object tag for the control. This
    > page works on my computer, but just gives me a placeholder on the other
    > computers that I have tested it on. All I can say is that I am only
    > becoming more stumped as time goes by.
    >
    > Chris Lieb


    Ends up that since my version numbers were not set to auto increment
    and since I was not doing it manually, the test machines were not aware
    that the program had changed. I ended up having to go through and
    delete the OCX out of the Downloaded Programs folder and delete all of
    the registry keys that pointed to my control and then reloading the
    page. Everything now works correctly and I have setup
    auto-incrementing version numbers so that I should not run into any
    problems with this again.

    Chris Lieb
    Chris Lieb, Nov 29, 2005
    #5
  6. Chris Lieb wrote:

    > For the computers on our intranet, IE is set to allow all ActiveX
    > controls.


    ...and hopefully, none of these computers are allowed on the Internet.

    --
    -bts
    -Warning: I brake for lawn deer
    Beauregard T. Shagnasty, Nov 29, 2005
    #6
  7. Chris Lieb

    Mark Parnell Guest

    In our last episode, Chris Lieb <> pronounced to
    alt.html:

    > For the computers on our intranet, IE is set to allow all ActiveX
    > controls.


    Set to allow all ActiveX controls within the Intranet - not on the
    Internet, presumably.

    > 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.

    > I won't have to support any browsers other than IE6,


    Until management decide it's time to upgrade to a modern browser.

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


    For now.

    --
    Mark Parnell
    http://clarkecomputers.com.au
    Mark Parnell, Nov 29, 2005
    #7
  8. Chris Lieb

    Chris Lieb Guest

    Mark Parnell wrote:
    > In our last episode, Chris Lieb <> pronounced to
    > alt.html:
    >
    > > For the computers on our intranet, IE is set to allow all ActiveX
    > > controls.

    >
    > Set to allow all ActiveX controls within the Intranet - not on the
    > Internet, presumably.


    You would be correct, intranet only.

    > > 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.
    >
    > > I won't have to support any browsers other than IE6,

    >
    > Until management decide it's time to upgrade to a modern browser.


    I don't see that happening until looong after I am gone.

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

    >
    > For now.


    Even then, I see no other alternative than to create a client-side app,
    which is what we wanted to avoid in the first place.

    Chris Lieb
    Chris Lieb, Nov 29, 2005
    #8
  9. Chris Lieb

    rf Guest

    Mark Parnell wrote:

    > In our last episode, Chris Lieb <> 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.
    rf, Nov 29, 2005
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. shruds
    Replies:
    1
    Views:
    779
    John C. Bollinger
    Jan 27, 2006
  2. Vital Lobachevsky

    Embedding xlst element into html tag

    Vital Lobachevsky, May 8, 2004, in forum: XML
    Replies:
    1
    Views:
    427
    Patrick TJ McPhee
    May 8, 2004
  3. Replies:
    1
    Views:
    373
    Andrew Thompson
    Nov 29, 2006
  4. Perchance
    Replies:
    3
    Views:
    584
    J.O. Aho
    Jan 18, 2007
  5. Elie Grouchko

    Embedding an ActiveX Control

    Elie Grouchko, Nov 15, 2004, in forum: ASP General
    Replies:
    1
    Views:
    92
    Roland Hall
    Nov 15, 2004
Loading...

Share This Page