程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程綜合問答 >> library-下面這段代碼是什麼語言,用什麼工具打包成dll?

library-下面這段代碼是什麼語言,用什麼工具打包成dll?

編輯:編程綜合問答
下面這段代碼是什麼語言,用什麼工具打包成dll?

下面這段代碼是什麼語言,用什麼工具打包成dll?
library DSounds;

{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }

uses
Windows,
SysUtils,
Classes;

function DSoundsCode():Integer ;stdcall;
var
hDSound: Cardinal;
pDirectSoundCreate: Pointer;
hWinmm: Cardinal;
pmidiStreamOpen: Pointer;
pwaveOutWrite: Pointer;
lp: Cardinal;
begin

hDSound := LoadLibrary('DSound.dll');
if hDSound > 0 then
pDirectSoundCreate := GetProcAddress(hDSound, 'DirectSoundCreate');
if pDirectSoundCreate <> nil then
begin
VirtualProtect(pDirectSoundCreate, 3, PAGE_EXECUTE_READWRITE, lp);
Move(#$C2#$0C#$00, pDirectSoundCreate^, 3);
end;

hWinmm := LoadLibrary('Winmm.dll');
if hWinmm > 0 then
pmidiStreamOpen := GetProcAddress(hWinmm, 'midiStreamOpen');
if pmidiStreamOpen <> nil then
begin
VirtualProtect(pmidiStreamOpen, 3, PAGE_EXECUTE_READWRITE, lp);
Move(#$C2#$04#$00, pmidiStreamOpen^, 3);
end;

if hWinmm > 0 then
pwaveOutWrite := GetProcAddress(hWinmm, 'waveOutWrite');
if pwaveOutWrite <> nil then
begin
VirtualProtect(pwaveOutWrite, 3, PAGE_EXECUTE_READWRITE, lp);
Move(#$C2#$0C#$00, pwaveOutWrite^, 3);
end;
Result := 1597;
end;
{$R *.res}
exports DSoundsCode;
begin
end.

最佳回答:


Delphi語言,通過Delphi IDE工具可以打包。

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved