Using MSComm - important
From: Elrond <elrond_at_icn.pl>
Date: Sat, 19 Feb 2000 11:37:10 +0100
Message-ID: <88lrud$4rr$1_at_helios.man.lublin.pl>
Hi all,
I've got a question to all of you who have used the MSCOMM32.OCX. I've imported all it's methods and events and tried to send something to fiskal printer but i couldn't :((
Here is a piece of my code : ( interface is a variable correspods to :item('IO_BLOCK.IO_ITEM').interface
variant is OleVar type value
...
settings:='9600,N,8,1';
XMCommVBA_XMComm.Output(:item('IO_BLOCK.IO').interface,variant); -- try to send it
Date: Sat, 19 Feb 2000 11:37:10 +0100
Message-ID: <88lrud$4rr$1_at_helios.man.lublin.pl>
Hi all,
I've got a question to all of you who have used the MSCOMM32.OCX. I've imported all it's methods and events and tried to send something to fiskal printer but i couldn't :((
Here is a piece of my code : ( interface is a variable correspods to :item('IO_BLOCK.IO_ITEM').interface
variant is OleVar type value
...
settings:='9600,N,8,1';
XMCommVBA_XMComm.CommPort(interface,1); -- choosing COM1 XMCommVBA_XMComm.Settings(interface,ust); -- setting this port XMCommVBA_XMComm.PortOpen(interface,1); -- opening port (i think so, but when I try to see -- if port is open i got -1) message( XMCommVBA_XMComm.PortOpen(interface)); -- why I've got -1 ??? text:='sample text'; -- making sample text to be send variant:=(to_variant(text,VT_BSTR)); -- setting variant variable to text message(VAR_TO_CHAR(variant)); -- Ok i've got'sample text';
XMCommVBA_XMComm.Output(:item('IO_BLOCK.IO').interface,variant); -- try to send it
- now i've got an error 100504
...
Can anybody help me ? sincerelly Maciej Myrcha