comp.lang.ada
 help / color / mirror / Atom feed
From: lynch@cci.de
Subject: Re: Win NT + Object Ada: serial port I/O
Date: 1999/02/04
Date: 1999-02-04T00:00:00+00:00	[thread overview]
Message-ID: <79bp3t$4dc$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 799g51$p0p$1@remarQ.com

First of all I would like to thank Martin C. Carlisle, Stephen Leake and
Steve Doiel for providing me with sample code for serial i/o.
It seems using the Win32 API is the "right" way, with all the unchecked
and 'Accesses that go with it. At least now that I know how to convert to
LPCVOID and co. I am making progess ;-)


In article <799g51$p0p$1@remarQ.com>,
  "news.oxy.com" <Vladimir_Olensky@oxy.com> wrote:
>
> lynch@cci.de wrote in message <79952r$2t$1@nnrp1.dejanews.com>...
[...]
> >2) Use the Win32Ada binding with CreateFile, SetCommTimeouts etc. however
> the
> > help file provided with Object Ada is utterly useless. I have yet to find
> >the section which "describes [...] the transformation rules (from C to
> Ada)"
> >Also the guy who will be using this DLL is worried about all the type
> >conversions etc. ("why use an Ada compiler if you're writing C anyway...")
>
> You should use Win32.hlp file instead.  It contains all the needed
> information.
[...]

The Win32.hlp file contains explanations of the various functions in C syntax
which of course are very useful, however the version that comes with Object
Ada has no "Contents" and the Index does not say much about communication.
"Communications Overview" tells me less than I know already. Some people
suggested looking at "Communcations Functions" however this does not appear
in the index. It is available via the "Group" link once you've found a
comms function by some other means. Typical Microsoft :-(

My main problem however is the help file for the Ada binding. After looking
through Win32.hlp I know that CreateFile() takes an LPCTSTR, which according
to Win32Ada.hlp is a "new Win32.PCSTR". I can't find PCSTR anywhere! Some of
the sample code uses LPCSTR (no T) which I can't find - what is the
difference?

ReadFile() takes an LPVOID, WriteFile() an LPCVOID, the help file only ever
specifies PCVOID, and so on...

Based on the names and the fact that the API is in C I can usually make a
good guess as to what the types are, but I would much prefer to have a clear
definition.


> The Windows NT is not such bad thing at all. When you get grasp of it'
> concepts many things will appear very simple. Windows NT programming is
> definitely much more complex then DOS-like programming. It requires many
> calls to low-level APIs and programmer should know them very well to write
> good code. That's why Companies that make this process more easier have a
> lot of success.
[...]
> Each system has it's own set of rules. If you do not obey that rules for any
> reason (e.g. - you just do not know them) then you may feel frustrated quite
> very often. This is just the same as with Ada.
>
[...]

Amen.

One of the reasons I find Windows so frustrating is that I come from a Unix
background with the odd bit of VMS tinkering and I am used to having plenty
of decent (hardcopy) documentation (bookshelfs full of SunOS binders, or the
"grey wall" etc.).

From my experience asking friends and colleagues for help with the Win32-API
the Windows attitute seems to be very much "suck it and see". The number of
times I hear "try this" or "maybe that will do it" drives me up the wall.

Anyway, thanks again to those who provided code, now I can start sucking...
(I've been infected already)

Andrew.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




  reply	other threads:[~1999-02-04  0:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-03  0:00 Win NT + Object Ada: serial port I/O lynch
1999-02-03  0:00 ` news.oxy.com
1999-02-04  0:00   ` lynch [this message]
1999-02-04  0:00     ` news.oxy.com
1999-02-04  0:00 ` dennison
1999-02-04  0:00   ` Tom Moran
1999-02-16  0:00   ` lynch
1999-02-16  0:00     ` Steve Doiel
1999-02-16  0:00     ` dennison
1999-02-17  0:00       ` Peter Hend�n
1999-02-16  0:00     ` David C. Hoos, Sr.
1999-02-16  0:00       ` dennison
1999-02-16  0:00     ` dennison
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox