Mark Hammond wrote:
The same process works fin in _vbscript_ on the example page from
MagTek..
    

Does it work from _vbscript_ executed via cscript/wscript?  If it only works
from _vbscript_ inside a webpage hosting the control, the problem will be that
you need an OCX "container" to host the control.  Pythonwin is capable (see
the pywin\demos\ocx dir), as is wxPython (but I've never use that).

Otherwise, can you post the _vbscript_ code which does work (just up to the
successful PortOpen property set)?

Cheers,

Mark

  
Thank you for the prompt answer Mark.
You betcha, I can post the _vbscript_!  ..and yes, it IS an OCX..  hmm, so I will need to treat this different then, than a regular COM?

Here is the code (found at http://www.magtek.com/support/software/demo_programs/usb_swipe_insert/swipe_read_parse.asp):

--------------------- code --------------------- start
<SCRIPT LANGUAGE="_vbscript_"><!--
Sub window_onLoad()
USBHID.PortOpen = True
If Not(USBHID.PortOpen)  then
  MsgBox "Unable to Open USB Reader"
End if
end sub


Sub window_onUnload()
  USBHID.PortOpen = False
end sub
Sub USBHID_CardDataChanged()
Document.MyForm.FIRST.Value = USBHID.GetFName()

[-- snipped for brevity --]

Document.MyForm.CARDDATA.Value = USBHID.CardData
USBHID.ClearBuffer()
end sub
-->
</SCRIPT>
<OBJECT ID="USBHID"
CLASSID="" class="moz-txt-link-rfc2396E" href="CLSID:22571E97-956A-4CDD-AF8D-AE9C26597683">"CLSID:22571E97-956A-4CDD-AF8D-AE9C26597683"
CODEBASE="">
</OBJECT>
------------------ code -----------------------------end

I looked in the OCX demos and saw that it does indeed seem to be handling it completely differently there...  instead of using Dispatch, it seems I should use the gencache.EnsureModule() method etc.  Problem is, which CLSID should I use for the call (there seems to be several different ones in the MakePY code that was generated).

_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to