From: Me on
Site is usefull but still cannot get it working.
Could you please email me sample code with how to handle VARIANT which keeps
popping up to
eddie(a)eddie1.net along with any other settings? I need all the help I can
get here please.


"Arlis Rose" <arlisATendevouraerospace.com> wrote in message
news:eLRuUg5EFHA.1836(a)tk2msftngp13.phx.gbl...
> Hey Me? :) Perhaps this will help, it's a tutorial for C# but talks about
> sending and receiving the null byte (and it's says it uses McComm.ocx) so
> hopefully it's what you are looking for.
> http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=320
>
> "Me" <me(a)right.her> wrote in message news:cx9Qd.21476$ya6.5062(a)trndny01...
>> Anyone know how I can send true hex bytes out com1 using MFC MSComm???
>> Please post examples.
>>
>
>


From: Scott McPhillips [MVP] on
Me wrote:
> "Joseph M. Newcomer" <newcomer(a)flounder.com> wrote in message
> news:mgh4119ckdq08m8f3n89t3g54u80innh7k(a)4ax.com...
>
>>My first inclination would be to ignore the existence of MSComm. Just open
>>the serial port
>>asynchronously and do WriteFile operations.
>>joe
> Your idea doesnt work with WindowsXP
> I used it with Win98 with no probs.

If you think the CreateFile/WriteFile APIs don't work for the serial
port in XP - you are mistaken. In fact, there is no doubt the MSComm
control uses these same APIs. If you already have API code that works
in Win98 then you are very very close to having an XP solution.

--
Scott McPhillips [VC++ MVP]

From: Joseph M. Newcomer on
What idea doesn't work with Windows XP? Not using MSCOMM? I have never used MSCOMM, and
I've done stuff that ran on Win95, Win98, Win2K and WinXP. Most of it required sending 0
bytes. THere are thousands of copies of my programs out there right now sending NUL
characters without experiencing any problems.
joe

On Tue, 15 Feb 2005 20:32:43 GMT, "Me" <me(a)right.her> wrote:

>Your idea doesnt work with WindowsXP
>I used it with Win98 with no probs.
>
>"Joseph M. Newcomer" <newcomer(a)flounder.com> wrote in message
>news:mgh4119ckdq08m8f3n89t3g54u80innh7k(a)4ax.com...
>> My first inclination would be to ignore the existence of MSComm. Just open
>> the serial port
>> asynchronously and do WriteFile operations.
>> joe
>>
>> On Mon, 14 Feb 2005 22:23:04 GMT, "Me" <me(a)right.her> wrote:
>>
>>>Anyone know how I can send true hex bytes out com1 using MFC MSComm???
>>>Please post examples.
>>>
>>
>> Joseph M. Newcomer [MVP]
>> email: newcomer(a)flounder.com
>> Web: http://www.flounder.com
>> MVP Tips: http://www.flounder.com/mvp_tips.htm
>

Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Joseph M. Newcomer on
If it works on Win98 it works on XP. In fact, I did a Win95 implementation back in 1997,
and it came back to me a few months ago to get upgrades for the new line of controllers. I
debugged it on WinXP. It worked perfelctly; I made no changes in the serial port, nor did
I need to make any when it moved to Win98, which it had done after I delivered it.. So
CreateFile/WriteFile worked perfectly on Win95, Win98, Win2K and WinXP without change.

Besides, that's all MSCOMM can do, as pointed out. There IS no other way to write to a
serial port other than WriteFile; therefore it must work. MSCOMM is nothing more than a
fancy wrapper around a WriteFile (and ReadFile, and presumably CreateFile, and
CloseHandle). So I chose to ignore the wrapper and go for the raw port. It doesn't take
much work.
joe

On Tue, 15 Feb 2005 18:08:31 -0500, "Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp>
wrote:

>Me wrote:
>> "Joseph M. Newcomer" <newcomer(a)flounder.com> wrote in message
>> news:mgh4119ckdq08m8f3n89t3g54u80innh7k(a)4ax.com...
>>
>>>My first inclination would be to ignore the existence of MSComm. Just open
>>>the serial port
>>>asynchronously and do WriteFile operations.
>>>joe
>> Your idea doesnt work with WindowsXP
>> I used it with Win98 with no probs.
>
>If you think the CreateFile/WriteFile APIs don't work for the serial
>port in XP - you are mistaken. In fact, there is no doubt the MSComm
>control uses these same APIs. If you already have API code that works
>in Win98 then you are very very close to having an XP solution.

Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Thomas Lutz on
The trick to getting the MSComm32.OCX ActiveX control to send and
receive "binary" data (Hex 00-FF) is to first set the "InputMode"
property to "ComImputModeBinary" or 1.

When you set the InputMode property of the MSComm32.OCX to 1, then
when you read input from the control you will be reading a "Byte
Array" and when you send data out the port you need to set the Output
property to a Byte Array.

It also works just fine under all 32 bit versions of Windows - no
matter what anyone else says to the contrary.

If you are writing code in MFC then you could also incorporate the
code that is in the sample serial communications program that
Microsoft provides in the MSDN.
You can download it using the following URL:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfiles/html/msdn_serial.asp

For more serial I/O information or free utilities, visit
www.taltech.com




On Mon, 14 Feb 2005 22:23:04 GMT, "Me" <me(a)right.her> wrote:

>Anyone know how I can send true hex bytes out com1 using MFC MSComm???
>Please post examples.
>