Hi,
i always resolve an "arrow up" instead an "A" when i do this (snipped!):
BYTE Byte;
Byte = 0x41;
PortWrite((BYTE)(&Byte));
BOOL PortWrite (BYTE Byte)
{
WriteFile (hPort, &Byte, sizeof (&Byte), NULL, NULL);
return TRUE;
}
what is the problem?
thx martin 8 2411
* Martin Petzold <mp******@gmx.net> schriebt:
This is off-topic in [comp.lang.c++].
Perhaps try [comp.os.ms-windows.programmer.win32]?
See the FAQ for some other possibilities & posting guidelines.
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Martin Petzold <mp******@gmx.net> spoke thus: i always resolve an "arrow up" instead an "A" when i do this (snipped!):
What Mr. Steinbach said, and also never multi-post again.
--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Martin Petzold wrote: I always resolve an "arrow up" instead an "A" when i do this (snipped!):
BYTE Byte;
Byte = 0x41; PortWrite((BYTE)(&Byte));
BOOL PortWrite (BYTE Byte) { WriteFile (hPort, &Byte, sizeof (&Byte), NULL, NULL); return TRUE; }
what is the problem?
You don't know what you are doing.
It appears that you are attempting to write the address of a BYTE
which contains the value 0x41.
On Mon, 12 Apr 2004 18:14:56 GMT in comp.lang.c++, al***@start.no (Alf
P. Steinbach) wrote, * Martin Petzold <mp******@gmx.net> schriebt:
This is off-topic in [comp.lang.c++].
No it's not. The difference between a char, and the address of a char,
and the address of an array of chars, is not to be ignored in any
standard implementation of C++.
"Martin Petzold" <mp******@gmx.net> wrote in message
news:c5**********@newsreader2.netcologne.de... Hi, i always resolve an "arrow up" instead an "A" when i do this (snipped!):
BYTE Byte;
Byte = 0x41; PortWrite((BYTE)(&Byte));
BOOL PortWrite (BYTE Byte) { WriteFile (hPort, &Byte, sizeof (&Byte), NULL, NULL); return TRUE; }
what is the problem?
thx martin
Assuming that WriteFile requires an address as the second parameter, and a
size as the third parameter, you are writing the size of an address rather
than the size of a byte.
Perhaps this will fix it:
WriteFile (hPort, &Byte, sizeof (Byte), NULL, NULL);
"Martin Petzold" <mp******@gmx.net> wrote in message
news:c5**********@newsreader2.netcologne.de... Hi, i always resolve an "arrow up" instead an "A" when i do this (snipped!):
BYTE Byte;
Byte = 0x41; PortWrite((BYTE)(&Byte));
PortWrite takes a BYTE, not a pointer to a BYTE, so just pass it Byte, not
the address of Byte. BOOL PortWrite (BYTE Byte) { WriteFile (hPort, &Byte, sizeof (&Byte), NULL, NULL);
If you're intending to write the value stored in Byte, then the size you
probably want is sizeof(BYTE), not the size of the address of the variable.
return TRUE; }
what is the problem?
thx martin
Perhaps you want this?
PortWrite(Byte);
....
BOOL PortWrite( BYTE Byte )
{
WriteFile( hPort, &Byte, sizeof(BYTE), NULL, NULL );
....
}
?
-Howard al***@start.no (Alf P. Steinbach) wrote in message news:<40****************@news.individual.net>... * Martin Petzold <mp******@gmx.net> schriebt:
This is off-topic in [comp.lang.c++].
Perhaps try [comp.os.ms-windows.programmer.win32]?
See the FAQ for some other possibilities & posting guidelines.
Aside from the fact that you're OT, you should use "sizeof(Byte)"
instead of "sizeof(&Byte)". This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Dan |
last post by:
I wnat to see in browser an status from an device connected on rs232
port
The java class for read from serial port is:
//Serial.java
import java.io.*;
import java.util.*;
import...
|
by: Bob Greschke |
last post by:
We have some equipment that communicates at 57600 baud RS232. The path from
the PC is USB to a Phillips USB hub, then off of that a TUSB3410 USB/Serial
converter. The driver for the 3410 chip...
|
by: Martin Petzold |
last post by:
Hi,
i always receive an "arrow up" instead an "A" when i do this (snipped!):
BYTE Byte;
Byte = 0x41;
PortWrite((BYTE)(&Byte));
BOOL PortWrite (BYTE Byte)
{
|
by: Terry Olsen |
last post by:
I'm trying to use the RS232 class that was in the Platform SDK (i think).
Has anyone else used this with events successfully? Here's what i've got:
======================
Public WithEvents...
|
by: Tony Papadimitriou |
last post by:
Hi all,
I've written an app using RS232.VB (by Keith Langer 2/5/02 -- Modified to
handle overlapped IO and provide asynchronous read/write) and the executable
works as expected under XP Pro but,...
|
by: jay.dow |
last post by:
I want to write to the pins of an RS232 without using the serial
protocol. The use would be every pin could act to complete a circuit
in customized hardware. I could use python to communicate...
|
by: jyotish.bora |
last post by:
Hi ,
i m trying to send a message packet to a RS232 port. I have created the
handle and set the parameters. Now the general format of the packet is
<STX>command<ETX><LRC>
I have also written...
|
by: j.aloussi |
last post by:
Hello,
I am developing a serial-communication application for a pocket-PC and
a PC.
I am trying to make a serial-port connection via Bluetooth. All goes
well: Bluetooth connection and COM...
|
by: zektor |
last post by:
Hi there, I have an application that have 1 backgroundworker doing operation in hw through rs232 (like a pooling constantly). In my UI thread I have do operations also on that resource (rs232...
|
by: Xavier |
last post by:
Hi,
I try to access to a Bluetooth GPS data-logger with Python. I use
pySerial.
Sending and receiving little messages (~100 char) works fine. However,
when I ask the GPS to dump the trails,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |