Dolphin X6 ActiveX Error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Dolphin X6 ActiveX Error

gregarican
There is a USB magnetic stripe reader that I'm trying to tap into using
Dolphin X6. I love the ActiveX Component Wizard and how easy it makes
it to bring in controls into my image. The magstripe reader came
bundled with an OCX file that I registered and used the wizard to add
the IDispatch subclass into my environment. I can create a new instance
of this CtlUSBHID_USBHID class, and invoke several instance methods
without a problem.

But when I try to open the communications port to process in a
magstripe read I receive an error stating "Client Site not available
(FACILITY_CONTROL)." Is this error something that anyone is familiar
with in that it's just a quick tweak somewhere? The method I'm trying
looks like this:

portOpen: arg1
        "Set the 'PortOpen' property of the receiver to the <varbool> value of
the argument."

        self put_PortOpen: arg1

which passes a message to the private method:

put_PortOpen: arg1
        "Private - Set the value of the 'PortOpen' property of the object
wrapped by the
         receiver to the <varbool> argument, arg1.

                HRESULT __stdcall PortOpen(
                        [in]VARIANT_BOOL arg1);"

        <virtual stdcall: hresult 501 varbool>
        ^self invalidCall

I've googled for this specific error message and only found a couple of
references where a Python developer ran into something similar. No
specific resolution steps that I saw other than vendors supplying
updated OCX files. But my file is the latest available.

Anyone have a point in the right direction?


Reply | Threaded
Open this post in threaded view
|

Re: Dolphin X6 ActiveX Error

gregarican
Looking a bit deeper I see that this message can involve an ActiveX
control that doesn't reside within a container. Not sure if that's the
job of whomever coded the OCX file I am using or if I need to do this
somehow in my Dolphin image :-(

gregarican wrote:

> There is a USB magnetic stripe reader that I'm trying to tap into using
> Dolphin X6. I love the ActiveX Component Wizard and how easy it makes
> it to bring in controls into my image. The magstripe reader came
> bundled with an OCX file that I registered and used the wizard to add
> the IDispatch subclass into my environment. I can create a new instance
> of this CtlUSBHID_USBHID class, and invoke several instance methods
> without a problem.
>
> But when I try to open the communications port to process in a
> magstripe read I receive an error stating "Client Site not available
> (FACILITY_CONTROL)." Is this error something that anyone is familiar
> with in that it's just a quick tweak somewhere? The method I'm trying
> looks like this:
>
> portOpen: arg1
> "Set the 'PortOpen' property of the receiver to the <varbool> value of
> the argument."
>
> self put_PortOpen: arg1
>
> which passes a message to the private method:
>
> put_PortOpen: arg1
> "Private - Set the value of the 'PortOpen' property of the object
> wrapped by the
> receiver to the <varbool> argument, arg1.
>
> HRESULT __stdcall PortOpen(
> [in]VARIANT_BOOL arg1);"
>
> <virtual stdcall: hresult 501 varbool>
> ^self invalidCall
>
> I've googled for this specific error message and only found a couple of
> references where a Python developer ran into something similar. No
> specific resolution steps that I saw other than vendors supplying
> updated OCX files. But my file is the latest available.
>
> Anyone have a point in the right direction?


Reply | Threaded
Open this post in threaded view
|

Re: Dolphin X6 ActiveX Error

gregarican
Just for some closure I was alerted to the root cause of the error by
someone posting a reply on a Python newsgroup thread I created on the
same subject. In case anyone runs into a similar issue here's the
thread -->
http://groups.google.com/group/comp.lang.python/browse_frm/thread/1a06cc5368883213/57558690f50f9008#57558690f50f9008.

gregarican wrote:

> Looking a bit deeper I see that this message can involve an ActiveX
> control that doesn't reside within a container. Not sure if that's the
> job of whomever coded the OCX file I am using or if I need to do this
> somehow in my Dolphin image :-(
>
> gregarican wrote:
> > There is a USB magnetic stripe reader that I'm trying to tap into using
> > Dolphin X6. I love the ActiveX Component Wizard and how easy it makes
> > it to bring in controls into my image. The magstripe reader came
> > bundled with an OCX file that I registered and used the wizard to add
> > the IDispatch subclass into my environment. I can create a new instance
> > of this CtlUSBHID_USBHID class, and invoke several instance methods
> > without a problem.
> >
> > But when I try to open the communications port to process in a
> > magstripe read I receive an error stating "Client Site not available
> > (FACILITY_CONTROL)." Is this error something that anyone is familiar
> > with in that it's just a quick tweak somewhere? The method I'm trying
> > looks like this:
> >
> > portOpen: arg1
> > "Set the 'PortOpen' property of the receiver to the <varbool> value of
> > the argument."
> >
> > self put_PortOpen: arg1
> >
> > which passes a message to the private method:
> >
> > put_PortOpen: arg1
> > "Private - Set the value of the 'PortOpen' property of the object
> > wrapped by the
> > receiver to the <varbool> argument, arg1.
> >
> > HRESULT __stdcall PortOpen(
> > [in]VARIANT_BOOL arg1);"
> >
> > <virtual stdcall: hresult 501 varbool>
> > ^self invalidCall
> >
> > I've googled for this specific error message and only found a couple of
> > references where a Python developer ran into something similar. No
> > specific resolution steps that I saw other than vendors supplying
> > updated OCX files. But my file is the latest available.
> >
> > Anyone have a point in the right direction?


Reply | Threaded
Open this post in threaded view
|

Re: Dolphin X6 ActiveX Error

Chris Uppal-3
gregarican wrote:

> Just for some closure [...]

Does that mean you have a working solution ?

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: Dolphin X6 ActiveX Error

gregarican
I think so. Haven't coded it yet, but have sample code in Python that I
can use to get an idea what I need to do in Dolphin. Thanks for asking!

Chris Uppal wrote:
> gregarican wrote:
>
> > Just for some closure [...]
>
> Does that mean you have a working solution ?
>
>     -- chris


Reply | Threaded
Open this post in threaded view
|

Re: Dolphin X6 ActiveX Error

Blair
In reply to this post by gregarican
"gregarican" <[hidden email]> wrote in message
news:[hidden email]...
> Looking a bit deeper I see that this message can involve an ActiveX
> control that doesn't reside within a container. Not sure if that's the
> job of whomever coded the OCX file I am using or if I need to do this
> somehow in my Dolphin image :-(
>

You almost certainly need to host it inside an AXControlSite to get it to
work. Unfortunately this is quite common, even for "controls" that are
really non-visual objects that really shouldn't need to be hosted. You can
test this out easily by trying to create an instance of it inside the
Active-X control browser and see if it works there.

It is possible to set up an AXControlSite programmatically without having to
do anything nasty such as putting an invisible one in your view. This is as
simple as:

site := AXControlSite progId: '<your control prod id here - can be the
string representation of the CLSID including the curly brackets too>'.
object := site controlDispatch.
...
object free.
site destroy.

Don't forget the site destroy, as without it your program will leak.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: Dolphin X6 ActiveX Error

gregarican
Gotcha. Thanks for the example of how to accomplish this
quickly/cleanly. This should make things relatively smooth. Appreciate
the insight!

Blair wrote:

> "gregarican" <[hidden email]> wrote in message
> news:[hidden email]...
> > Looking a bit deeper I see that this message can involve an ActiveX
> > control that doesn't reside within a container. Not sure if that's the
> > job of whomever coded the OCX file I am using or if I need to do this
> > somehow in my Dolphin image :-(
> >
>
> You almost certainly need to host it inside an AXControlSite to get it to
> work. Unfortunately this is quite common, even for "controls" that are
> really non-visual objects that really shouldn't need to be hosted. You can
> test this out easily by trying to create an instance of it inside the
> Active-X control browser and see if it works there.
>
> It is possible to set up an AXControlSite programmatically without having to
> do anything nasty such as putting an invisible one in your view. This is as
> simple as:
>
> site := AXControlSite progId: '<your control prod id here - can be the
> string representation of the CLSID including the curly brackets too>'.
> object := site controlDispatch.
> ...
> object free.
> site destroy.
>
> Don't forget the site destroy, as without it your program will leak.
>
> Regards
>
> Blair