in reply to Perl for OLE & OCX

Short for OLE Control Extension, an independent program module that can be accessed by other programs in a Windows environment. OCX controls end with a .ocx extension. OCX controls represent Microsoft's second generation of control architecture, the first being VBX controls written in Visual Basic.

Both VBX and OCX controls have now been superseded by ActiveX controls. However, ActiveX is backward compatible with OCX controls, which means that ActiveX containers, such as Microsoft's Internet Explorer, can execute OCX components.

From: http://216.239.59.104/search?q=cache:ZeIpZRTRifMJ:www.webopedia.com/TERM/O/OCX.html+ocx&hl=en

An ocx is just a component control, without having a container object perl has no way to access them.

"Perl for Win32 cannot currently use OCX controls, which require additional OLE support."
From Learning Perl on Win32 Chapter 19

"The Win32::OLE module uses the IDispatch interface exclusively. It is not possible to access a custom OLE interface. OLE events and OCX's are currently not supported.

Actually, that's no longer strictly true. This module now contains ALPHA level support for OLE events. This is largely untested and the specific interface might still change in the future." from the Active State docs on Win32::OLE

update:
I wouldn't say that not supporting an ocx is defective of perl. OCX's are designed to compile with a vb project. Which is different from OLE, you can add OLE support into an OCX but the application that compiles the OCX does the automation the functions for the OCX are added to the applications. From further reading of Win32 Perl Programming bvy Dave Roth, and MSDN it appears that ActiveX (.ocx files) can be built to include an IDispatch interface. If this ocx lacks that it needs the container object.

"No matter where you go, there you are." BB

Replies are listed 'Best First'.
Re^2: Perl for OLE & OCX
by meetraz (Hermit) on Jun 16, 2004 at 17:01 UTC

      It would depend on how the OCX was written. My guess is from the above description, this is just a control set meant to be embedded in a VB app.

      "No matter where you go, there you are." BB
        I think you're right. Unless AxWindow can host it somehow, I am dead in the water and will have to change to VB to accomplish my goals.

        If any AxWindow expert can show me a way to do this, I will give it a try. I am looking over the docs now. But I think it highly likely I will be forced to admit defeat and get out the credit card and buy VB.

        My Gawd I hate to do that.... ;)

        Nathan

      I dunno. Is it???

      I guess I will look into it, but I am becoming convinced that Perl is the wrong tool for this job, I guess. Unless some kind soul can show me a way......

      Nathan

Re^2:Perl for OLE & OCX
by wa4otj (Beadle) on Jun 16, 2004 at 17:09 UTC
    I guess some of the subtlties are lost on me.

    Sounds like my quest is quixotic and I should abandon Perl for this project until some future point.

    Unless someone can show me a way to embed my code in an ActiveX container???

    Live and learn.

      I would say it is not you, it is Microsoft. As I remember and anyone can correct me if I am wrong as the subject was introduced to me in an almost backwards order. OCX were originally just toolsetas, that were used to give vb apps more tools. You would use OCX controls to add widgets and functions not available directly from the os or vb. ActiveX became the preferred means of doing this and I believe kept the same extension name. So ActiveX is OCX. It is up to the developer of the OCX on what functionality the component has. From the descript of the above, and the reference to VB calls to the OCX I believe it was meant to be embedded in a VB application and has no means of OLE automation on its own. I can not say that positively without seeing the documentation for the object in question.

      I think this has a good overview of the technology from Microsoft's point of view The Component Object Model (COM) and its related COM-based technologies:

      "No matter where you go, there you are." BB