Article View: pl.comp.lang.delphi
Article #334660Re: Przejęcie odwołania funkcji obsługi plików w DLL
From: xbary
Date: Tue, 10 Jan 2012 20:01
Date: Tue, 10 Jan 2012 20:01
99 lines
3941 bytes
3941 bytes
On 10 Sty, 20:14, "marfi" <marfi @bb.onet.pl> wrote:
> U ytkownik "xbary" <xb...@wp.pl> napisa w wiadomo cinews:75934d7e-dc45-4c01-a2ac-36a9e13814b9@i6g2000vbk.googlegroups.com...
> ...>Problem polega na tym e ow bitmap chcia bym wczyta z jakiego
> >TStream lub bezpo rednio z pami ci... ???
>
> ...
>
> Zale y jak biblioteka korzysta z pliku ale moze prze knie odczyt z "named
> pipe" czyli np. w w tku tworzysz i piszesz do pipe:
>
> hPipe:=CreateNamedPipe('\\.\pipe\mypipe',
> PIPE_ACCESS_OUTBOUND OR FILE_FLAG_WRITE_THROUGH,
> PIPE_TYPE_BYTE OR PIPE_WAIT,1,512,512,1000,nil);
> if hPipe...
>
> bRet:=ConnectNamedPipe(hPipe, nil);
> if bRet ...
>
> bRet := WriteFile(hPipe, buf, 512, WR, nil);
>
> if bRet ...
>
> CloseHandle(hPipe);
>
> A do biblioteki przesy asz nazw pliku '\\.\pipe\mypipe'.
>
> --
> marfi
Zrobiłem tak jak napisałeś oto kod procedurki:
PROCEDURE Front_Init;
VAR
s: STRING;
HPipe, wr: Cardinal;
bRet: LongBool;
ms: TMemoryStream;
BEGIN
HPipe := 0;
ms := NIL;
TRY
ms := TMemoryStream.Create;
s := ExtractFilePath(Application.ExeName) + '000\0001.bmp';
ms.LoadFromFile(s);
ms.Position := 0;
HPipe := CreateNamedPipe(
PChar('\\.\pipe\mypipe'),
PIPE_ACCESS_OUTBOUND OR FILE_FLAG_WRITE_THROUGH,
PIPE_TYPE_BYTE OR PIPE_WAIT,
1,
ms.size,
ms.size,
1000,
NIL);
CASE HPipe OF
INVALID_HANDLE_VALUE:
BEGIN
MessageBox(0, 'NVALID_HANDLE_VALUE', 'ERROR', 0);
Exit;
END;
ERROR_INVALID_PARAMETER:
BEGIN
MessageBox(0, 'ERROR_INVALID_PARAMETER', 'ERROR', 0);
Exit;
END;
PIPE_UNLIMITED_INSTANCES:
BEGIN
MessageBox(0, 'PIPE_UNLIMITED_INSTANCES', 'ERROR', 0);
Exit;
END;
END;
bRet := ConnectNamedPipe(HPipe, NIL);
IF bRet THEN
BEGIN
bRet := WriteFile(HPipe, ms.Memory, ms.size, wr, NIL);
IF bRet THEN
BEGIN
FrontSurface := al_load_bitmap('\\.\pipe\mypipe',
al_default_Palette);
END;
END;
GameResult := grFrontWait;
Tool_Reload(2);
Flip := true;
FINALLY
IF HPipe <> 0 THEN CloseHandle(HPipe);
IF ms <> NIL THEN FreeAndNil(ms);
END;
END;
i program stoi na bRet := ConnectNamedPipe(HPipe, NIL);
hmm nie wiem co jest grane...
Technical Details
Message-ID:
<507a36b4-a163-4bf5-9044-c366f1e9efea@h13g2000vbn.googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!plix.pl!newsfeed1.plix.pl!newspeer1.de.telia.net!newspeer4.de.telia.net!de.telia.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.21.MISMATCH!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!h13g2000vbn.googlegroups.com!not-for-mailReferences:
<75934d7e-dc45-4c01-a2ac-36a9e13814b9@i6g2000vbk.googlegroups.com> <4f0c8e2c$0$1465$65785112@news.neostrada.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!plix.pl!newsfeed1.plix.pl!newspeer1.de.telia.net!newspeer4.de.telia.net!de.telia.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.21.MISMATCH!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!h13g2000vbn.googlegroups.com!not-for-mail From: xbary <xbary@wp.pl> Newsgroups: pl.comp.lang.delphi Subject: Re: Przejęcie odwołania funkcji obsługi plików w DLL Date: Tue, 10 Jan 2012 12:01:10 -0800 (PST) Organization: http://groups.google.com Lines: 103 Message-ID: <507a36b4-a163-4bf5-9044-c366f1e9efea@h13g2000vbn.googlegroups.com> References: <75934d7e-dc45-4c01-a2ac-36a9e13814b9@i6g2000vbk.googlegroups.com> <4f0c8e2c$0$1465$65785112@news.neostrada.pl> NNTP-Posting-Host: 83.23.77.177 Mime-Version: 1.0 X-Trace: posting.google.com 1326225671 25944 127.0.0.1 (10 Jan 2012 20:01:11 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 10 Jan 2012 20:01:11 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: h13g2000vbn.googlegroups.com; posting-host=83.23.77.177; posting-account=YqNsWQoAAAA_7yhX7SRaVTGU6Fb5-oXn User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1,gzip(gfe) Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit