Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2002-10

New for Windows programming

6 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Raivo Nael

Hi,

i have good experience with Turbo Pascal under DOS. Now i need to get Windows interface for some of my applications.
I downloaded Free Pascal and Dev-Pascal IDE. It seems to be very good expect that i can not find any documentation or descriptions for windows units (theese are located on rtl\ folder). So my question is where do get data on windows functions. Another question is about accessing com port under windows. I have some turbo pascal DOS based programms that communicate with microcontrollers through PC serial port. What is the easyest way to get them working under Windows?

Regards,
Raivo

_________________________________________________________________ Unlimited Internet access for only $21.95/month.� Try MSN! http://resourcecenter.msn.com/access/plans/2monthsfree.asp

Jonas Maebe
to Raivo Nael
Raivo Nael wrote 6 lines
i have good experience with Turbo Pascal under DOS. Now i need to get Windows interface for some of my applications. I downloaded Free Pascal and Dev-Pascal IDE. It seems to be very good expect that i can not find any documentation or descriptions for windows units (theese are located on rtl\ folder). So my question is where do get data on windows functions.

Have a look at the bottom of <http://www.freepascal.org/docs.html>.

Another question is about accessing com port under windows. I have some turbo pascal DOS based programms that communicate with microcontrollers through PC serial port. What is the easyest way to get them working under Windows?

I don't know, but I do know you can't just write directly to the ports anymore like under Dos. You'll probably have to use some Windows API functions. Maybe you can even find something on the contributed units page.

Jonas

Klaus Hartnegg
to Raivo Nael: i have good experience with Turbo Pascal under DOS. Now i need to get Windows interface…
Another question is about accessing com port under windows. I have some turbo pascal DOS based programms that communicate with microcontrollers through PC serial port. What is the easyest way to get them working under Windows?

I have the same problem.

I found some demos on the web page (click in left row on "units"), download elecom12, read file win32com.pas (Com_Open, Com_SendChar, ...) Seems one must use an API call for initializing (SetCommState) and provide callback functions for sending and receiving. I think the Win32 API doc is also available somewhere on Free Pascal Web page. Google Search for "SetCommState" also finds some info on e Microsoft web page.

Does somebody have a minimal demo source?

Klaus

Klaus Hartnegg, Brain Research Group, University Freiburg, Germany Hansa-strasse 9, D-79104 Freiburg, Tel: +49 (0)761 203 9514, Fax 9540 www.brain.uni-freiburg.de/~klaus/
Unknown author
Show quoted text 24 lines
From: "Klaus Hartnegg" Date: 2002/10/17 Thu AM 10:11:35 EDT To: Subject: Re: [fpc-pascal]New for Windows programming > Another question is about accessing com port under windows. > I have some turbo pascal DOS based programms that communicate with > microcontrollers through PC serial port. What is the easyest way to get them > working under Windows? I have the same problem. I found some demos on the web page (click in left row on "units"), download elecom12, read file win32com.pas (Com_Open, Com_SendChar, ...) Seems one must use an API call for initializing (SetCommState) and provide callback functions for sending and receiving. I think the Win32 API doc is also available somewhere on Free Pascal Web page. Google Search for "SetCommState" also finds some info on e Microsoft web page. Does somebody have a minimal demo source? Klaus --

When I was doing programming (sometime ago) I was using Martin Bekers elecom unit, somewhat modified. Do a Google search on the net for elebbs and I am sure it's on his site.

It contains the source and some demo programs for Win32 stuff as well as OS/2 and DOS. Nothing for Linux unfortunately.

Frank

Anton Tichawa
to Unknown author
you wrote 38 lines
> From: "Klaus Hartnegg" > Date: 2002/10/17 Thu AM 10:11:35 EDT > To: > Subject: Re: [fpc-pascal]New for Windows programming > > > Another question is about accessing com port under windows. > > I have some turbo pascal DOS based programms that communicate with > > microcontrollers through PC serial port. What is the easyest way to get > > them working under Windows? > > I have the same problem. > > I found some demos on the web page (click in left row on "units"), > download elecom12, read file win32com.pas (Com_Open, Com_SendChar, ...) > Seems one must use an API call for initializing (SetCommState) > and provide callback functions for sending and receiving. > I think the Win32 API doc is also available somewhere on Free Pascal Web > page. Google Search for "SetCommState" also finds some info on e > Microsoft web page. > > Does somebody have a minimal demo source? > > Klaus > -- When I was doing programming (sometime ago) I was using Martin Bekers elecom unit, somewhat modified. Do a Google search on the net for elebbs and I am sure it's on his site. It contains the source and some demo programs for Win32 stuff as well as OS/2 and DOS. Nothing for Linux unfortunately. Frank _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

I don't have the time to look at my backupped sources, but as far as I remember, there is a windows-help file for the windows API, available at microsoft (some 20 or 30 MB). Also, when I worked with Delphi 4 and 6, this very help file was included in the Delphi distribution.

AFAIK, SetCommState is a way to setup the communication parameters (baudrate, parity, handshaking, ..), and OpenComm (or was it CreateComm?) opened the serial port and returned a file handle.

I did -not- use callback functions (windows 2000, delphi 6). After SetCommState/OpenComm(?) I used standard file I/O functions on the file handle returned by the API. At termination, or re-initialization, I had to use CloseHandle (or CloseFile or CloseComm?) to close the so-called file.

hth

Anton Tichawa.