Article View: pl.comp.lang.pascal
Article #92364Re: Lazarus i DLL ...
From: Mentor
Date: Wed, 02 Jan 2008 23:31
Date: Wed, 02 Jan 2008 23:31
52 lines
2391 bytes
2391 bytes
DarekM pisze:
> Mentor pisze:
>> Witam
>> Potrzebuje napisać w oparciu o biblioteke dll program który by
>> zczytywał dane ze sterownika PLC dane i zapisywał je w bazie danych....
>>
>> Biblioteka produkcji visilogic... "UnCmDrv1.dll"
>
>
> Nie wiem czy o to Ci chodzi. Poszukaj h2pas, który powinien generować z
> pliku nagłówkowego unit z deklaracjami funkcji z tej biblioteki.
>
>
> Darek
Może wstawie przykład z basica excel'a...
Dim mComDriver As UnCmDrv1.clsCommDriver
Dim WithEvents mTimer As UnCmDrv1.clsTimer
Private Function prvOpenPort() As Boolean
Dim eComParam As tPC_CommSettings '<<<< zmienna z biblioteki dll
'Create new instance of the Comm Driver Dll.
Set mComDriver = New UnCmDrv1.clsCommDriver '<< tutej mamy
utworzenie jak by klasy w zmiennej mComDriver
'Configure the connection parameters.
With eComParam
.Baudrate = eBR_38400
.DataBits = eDB_8
.Parity = eP_None
.StopBits = eSB_1
.TimeOut = 500
.Retries = 3
End With
mComDriver.Comm_Autodetect = True ' na ktorej wykonujemy operacje :/
mComDriver.ShowCommMessages = True
'Opens the com.
prvOpenPort = mComDriver.Comm_Open(Cells(5, 4), eComParam)
End Function
__________________________
Tu pytanie jak coś podobnego zrobić w delphi ?
vb wykazuje spis funkcji i procedór dll'a i clsCommDriver z samej nazwy
widać że to klasa osadzona w bibliotece dll
h2pas nie łyka tego wywala błąd
Pozdrawiam Mentor
Technical Details
Message-ID:
<flh6sa$8ju$1@inews.gazeta.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mailReferences:
<flgari$aff$1@inews.gazeta.pl> <flgrrt$7uj$2@atlantis.news.tpi.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail From: Mentor <mardoook@poczta.gazeta.pl> Newsgroups: pl.comp.lang.pascal Subject: Re: Lazarus i DLL ... Date: Thu, 03 Jan 2008 00:31:20 +0100 Organization: "Portal Gazeta.pl -> http://www.gazeta.pl" Lines: 52 Message-ID: <flh6sa$8ju$1@inews.gazeta.pl> References: <flgari$aff$1@inews.gazeta.pl> <flgrrt$7uj$2@atlantis.news.tpi.pl> NNTP-Posting-Host: cln85.neoplus.adsl.tpnet.pl Mime-Version: 1.0 X-Trace: inews.gazeta.pl 1199316682 8830 83.31.115.85 (2 Jan 2008 23:31:22 GMT) X-Complaints-To: usenet@agora.pl NNTP-Posting-Date: Wed, 2 Jan 2008 23:31:22 +0000 (UTC) X-User: mardoook In-Reply-To: <flgrrt$7uj$2@atlantis.news.tpi.pl> User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit