Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mscomm32.ocx beyond port limit

Status
Not open for further replies.

newtofoxpro

Programmer
Sep 16, 2007
301
IN
Using Xp, VFP9.

As I learn it's limit is 16. I have found some info to alter mscomm32.ocx unofficially. And provide information does not worked for me.

Please help
 
Pretty vague post there. What are you trying to do? And what are you trying to change? And why are you using that control as opposed to any other control or methodology?
On top of all that, mscomm32.ocx is a Micorsoft control and issues regarding that control don't really have to anything to do with VFP. So you would be much better off citing examples or issues with trying to use it with VFP rather than pointing out flaws of the control itself.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Please help with what?

If you want help altering a core Windows component I suspect this is the wrong place. Legal issues aside, this is a forum for questions about Visual FoxPro.

If you have a problem making something work, it's best to:

1) Say what you're trying to accomplish
2) Say what you've tried
3) Say what failed

Since you appear to be starting from the limitations of a Windows component perhaps you should explain your requirements first and someone may have experience with another component that both meet your needs and work well with VFP.
 
Patching OCXes is a good way to ruin your system, yes. Now revert that. That patch surely isn't official and will only work for a certain version of the OCX. And has nothing to do with VFP, has it?

Look for alternative OCXes or use CommTools. On XP it works,but since Vista I had problems with USB/RS232 Adapters. The problem is, that ports work for a while, then CommTools report a port to not exist, and we tried very many different adapters also with different chipsets.

I would recommend doing COM Port addressing in a DotNET assembly on todays systems. There is the System.IO.Ports.SerialPort class in C# or VB.NET, and that's working fine, and will continue to work fine, as the .NET framework is current and maintained.

Bye, Olaf.
 
Pretty vague post there"
"Please help with what?"

Sorry.

I am using Usb-Modem for sending messages. I am using code, which is written in vfp. I am using usb-modem similar to "Huawei E303FH Data Card"

I read this


"If you want help altering a core Windows component I suspect this is the wrong place"

Should I ask for Help ?
 
Can't you simply set the COM Port to a lower number? Are you really having that many ports?
If you just need to drive the USB Modem, look into device manager in serial ports. Don't hack the OCX.

Bye, Olaf.
 
Are you really having that many ports?
No
Can't you simply set the COM Port to a lower number?
No

The Usb-Modem itself having driver-setup. <Device Manager><Modem> shows port=21. I un-install driver-setup. And again install this time port=33

How can I set the COM port to a lower number ?
 
Yes I learn how to change com port. Code showing message "Error reading com device" Please give me time

Best Regards.
 
OK, so you could change the COM port number in the device manager, but the code fails to use the modem? Was it explicitly written for your modem? Or should it work generically with any Modem?

After reconfiguring try a reboot. My experience with just serial port adapters (merely USB devices being COM ports) were still seen as belonging to the initial port number, right after being changed in the device manager. It seems the new setting does not instantly propagate in the whole system. There are a bit of resources involved, eg the serial port buffers, etc. Maybe a garbage colletion problem. A system reset helps, I think.

You could also experiment with Hyperterminal before trying the VFP code.

Bye, Olaf.
 
I understand that there is no need to concentrate on mscomm32.ocx.

When I plug modem in usb port. Win-xp does not understand that I have plug modem and does not ask for installation. The modem has setup.exe. I run and install setup. and everything running fine with its modem-prorgram. I saw <Device manager> and found modem installed and showing port=13. I run my vfp code shows error "Error reading com device" I thought the port is used by modem-program and it is not available to vfp-code. I quit modem-program. vfp-code still showing error. Is modem still using port ? <Device manager> showing modem.

I re-start pc. I found <Device manager> does not show modem. its showing when modem-program runs.

vfp-code was running fine with "Huawei E303FH Data Card" which was borrowed from friend.

Any idea ?
Thanks & Best Regards.



 
Modem codes are very vendor and model specific, so you can forget to use the same code for another modem, more so, if it's a USB device.

I think there is no solution via COM.

What do you want to automate?

Bye, Olaf.
 
Have you tried using that port via Hyperterminal yet? Manually sending the commands? If you don't have Hyperterminal on your Windows version anymore, how about
I see the way you try it is not unusual, eg also tells newer USB modems provide a COM port as virtual device, as you also see it in device manager. But how about not coding this yourself, but using support libraries or servers, as the mentioned Diafaan SMS Server?

Bye, Olaf.
 
>I found <Device manager> does not show modem. its showing when modem-program runs.

I come to see that late.

That's another problem then: If the virtual simulated COM port is only present, when a modem vendor software runs, this is using the port and therefore locking it for usage from any other process. Ports need to be opened for usage and that means only one process can use a port at the same time. That's a limitation from Windows anyway, also for real COM ports. Only activating the virtual port driver, when that software runs may be intended to keep third party vendors from sending modem commands with other than the original manufacturer software.

If the VFP code works with the other modem of your friend, buy that modem instead. Obviously it doesn't have that limitation.

Bye, Olaf.
 
As advised, I tried HyperTermnial, everything worked fine.
I check my vfp code Problem comes with .Input I use this for response from modem.
I remove this .Input and pass all commands with .Output and worked fine.
But I can not get response, whether sms sent or not.

Best Regards.
 
Well,

to state the obvious .Input is for input, .Output for output.
You send via .Output and get responses via .Input.

Someone may help you with your code, if you show it.

Bye, Olaf.
 
IF ocomm.portopen
ocomm.Settings = "115200,N,8,1"
ocomm.RThreshold = 1
ocomm.Inputlen = 0
ocomm.HandShaking = 3
ocomm.RTSEnable = .T.
ocomm.Output = "AT"+CHR(13)
? ocomm.InBufferCount && --------- Return 87
? ocomm.Input &&---------- Problem at this line "Error reading com device"
ocomm.portopen=.f.
ENDIF
 
MSComm usage:


If I understand this correctly, you shoudl set Inputlen=0 to trigger reading input AFTER having sent the AT command, not beforehand.
Then you wouldn't read the Input directly, serial COM is a slow interface, wait.

Actually there is an event to use, to read the input buffer: OnComm, described

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top