Hi all, I have a cash drawer and and opener device connected to a USB port that is bridged to a COM16 serial port. According to the vendor I just need to send char(27)+char(53) down the serial port andit will open the cash drawer. They provide a MS Excel VBA sample which uses MScomm32.ocx and it works. But I have difficulties using that ocx file in PB 8. Is there someone here who can give me the required steps to implement and use that ocx in PB? Even better would be a code example.
Someone suggested to create a window, do insert-->control-->OLE and select the MScomm32.ocx file. So I did that and created a command button with the code to open the com port and send the string. But all I get is an error of something like 'invalid access of object property'. If someone could help me with this that would be great. Thanks for thinking about it. Hans ---== Posted via the PFCGuide Web Newsreader ==--- fisher, 1:55 น.
Hi Roland, Thanks for responding. The tiger and the snow torrent download. Unfortunately this doesn't work for me. I put the MSCOMM32.ocx into c: windows system32, put an OLE control on a window (insert-->control-->ole, created a command button and for that a script with the commands you suggested. But it comes back with 'invalid external function property for the first command. I did NOT declare any global functions. So the question is, did you and wich ones? Regards Hans On 26 Dec 2007 08:27:18 -0800, in sybase.public.powerbuilder.ole-ocx-activex Hans, 8:31 น.
Did you run regsvr32 on MSCOMM32.ocx? I did this from a new app specifically for trying this out. Here are my steps: Open the New window and go to the 'PB Object' tab Choose Standard Visual and click OK Choose olecontrol and click OK Switch to the Insert Control tab Scroll down and select Microsoft Communications Control Click OK Save the object as u_mscomm32 Place the object on a window with the control name ole_1 'Hans' wrote in message news:4777c6b7$1@forums-1-dub. Hans, 9:31 น. That is GREAT!!!
Re: Serial Port Communications within Excel I know this is an old post but this may be of use to someone, could not get mscomm32 to work and eventually stumbled on to an ocx file called NETComm, this is a free download and must be registered under the system32 directory in win 7 64bit.
Not sure what I did wrong when I tried it but it works!!! Only thing I can't do is read from the port.
The connected device sends a status back wich is 'ESC + 60' if the drawer is open. In order to read I did this (after opening the port of course): blob rsdata string data rsdata = ole_1.object.input data = string (rsdata) The program runs over the statements and does not give any error message but the variabe is empty. If you could help me also with this I would be infinitely grateful. On 31 Dec 2007 05:24:10 -0800, in sybase.public.powerbuilder.ole-ocx-activex Roland Smith [TeamSybase] wrote: >Did you run regsvr32 on MSCOMM32.ocx? > >I did this from a new app specifically for trying this out. Here are my >steps: > >Open the New window and go to the 'PB Object' tab >Choose Standard Visual and click OK >Choose olecontrol and click OK >Switch to the Insert Control tab >Scroll down and select Microsoft Communications Control >Click OK >Save the object as u_mscomm32 >Place the object on a window with the control name ole_1 > > Roland Smith [TeamSybase] 3/1/2008, 5:00 น.