Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

calling openComm (WinAPI) fails

13 views
Skip to first unread message

Dieter Lohse

unread,
Oct 22, 2001, 8:19:44 PM10/22/01
to
Hello,

I want to open a serial port by ObjectPal code.

Code in Uses-block:
Uses USER
OpenComm(comstr CPTR, InQueue CLONG, OutQueue CLONG) CWORD
endUses

Code in pushButton-method:
method pushButton(var eventInfo Event)
ComId = openComm(comstr,inqueue,outqueue)
endmethod

After calling the opencomm-function the variable comstr ("COM1") is
destroyed an the port will not open.
Calling other WinAPI-functions with string parameters works properly.
I´m using Paradox7(16bit) on Win95b.

Can anybody help me?

Dieter Lohse

Jure Zorko

unread,
Oct 23, 2001, 1:58:26 AM10/23/01
to
Look at thread "textStreaming to printers attached to COM ports" in this
group.

There I put a library with dll to manage com ports.

Jure

"Dieter Lohse" <Dieter...@t-online.de> wrote in message
news:3BD4B7A0...@t-online.de...

Dieter Lohse

unread,
Oct 23, 2001, 7:06:15 AM10/23/01
to
Dear Jure!

Sorry, but I cannot find your posting in that thread.

Dieter

Jure Zorko schrieb:

Liz

unread,
Oct 23, 2001, 10:24:29 AM10/23/01
to
Subject: Re: textStreaming to printers attached to COM ports
Date: Tue, 16 Oct 2001 15:14:55 +0200
From: "Jure Zorko" <jure....@b2-ic.si>
Newsgroups: corel.wpoffice.paradox-dev

Liz

Dieter Lohse

unread,
Oct 27, 2001, 6:39:28 PM10/27/01
to
Thanks for the library, but unfortunately it doesn’t work with my
Paradox7-16. I have to use the 16bit-API
(User.exe). Perhaps someone else knows the bug. Other DLL-calls are working
right, only calling OpenComm fails. After calling OpenComm the value and
size of the variable comstr ("COM1") has changed and the function returns no
value. The error occurs on all my machines from WfW 3.11 over Win95b to
WinME, so it seems to be a Pdox problem. Calling OpenComm by Delphi code is
working correct. Meanwhile I've spend some nights with this problem and I
would be glad if somebody knows a solution.

Dieter

Manuele Grueff

unread,
Jan 5, 2002, 1:22:12 PM1/5/02
to
Try changing the uses block (substitute USER with user, CLONG with CWORD):

Uses user
OpenComm(lpComName CPTR,wInQueue CWORD,wOutQueue CWORD) CWORD
enduser

By the way, do you correctly initialize wInQueue and wOutQueue to a
reasonable value?

Remember that before you can correctly use the port you should also use
BuildCommDCB and SetCommDCB to stup the port as you wish.

(I was the creator of the library Jure Zorko posted! It's nice to see that
it is still useful to somebody!)

By the way, if you want it, i have, somewhere in my old backups, a 16bits
version of Comm32.lsl...

--
Manuele Grueff
IT Consulting, Database & Web design
http://www.nannifa.it/atipica
sho...@paradoxcommunity.com

0 new messages