H
honghunter
Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
(* begin
呼叫 Inject.DLL export 函数的宣告 *)
function InjectDLL(ProcID: DWORD;dll: LPCTSTR)WORD;stdcall;external 'Inject.DLL';
//function GetProcByName(char * name);stdcall;external 'Inject.DLL';
function GetProcByName(char: Pchar)WORD;stdcall;external 'Inject.DLL';
(* end 呼叫 Inject.DLL export 函数的宣告 *)
procedure TForm1.Button1Click(Sender: TObject);
var
ProcID : dword;
procResult : String;
fileName : String;
fileName1 : LPCTSTR;
begin
fileName := 'uedit32.exe' ;
ProcID := GetProcByName(Pchar(fileName));
fileName1 := 'Inject.dll' ;
procResult := InjectDLL(ProcID,fileName);
TForm1.Edit1.text := inttostr(procResult)
end;
end;
==================下面是报的错=========
Build
[Error] Unit1.pas(48): Incompatible types: 'String' and 'PAnsiChar'
[Error] Unit1.pas(50): Method identifier expected
[Error] Unit1.pas(50): There is no overloaded version of 'IntToStr' that can be called with these arguments
[Error] Unit1.pas(55): '.' expected but ';' found
[Error] Unit1.pas(14): Unsatisfied forward or external declaration: 'TForm1.FormCreate'
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'
大家帮帮忙看看,错在那里了啊?
我是Delphi初学者,目前基本上对Delphi还是一窍不通。但我会努力学习的!
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
(* begin
呼叫 Inject.DLL export 函数的宣告 *)
function InjectDLL(ProcID: DWORD;dll: LPCTSTR)WORD;stdcall;external 'Inject.DLL';
//function GetProcByName(char * name);stdcall;external 'Inject.DLL';
function GetProcByName(char: Pchar)WORD;stdcall;external 'Inject.DLL';
(* end 呼叫 Inject.DLL export 函数的宣告 *)
procedure TForm1.Button1Click(Sender: TObject);
var
ProcID : dword;
procResult : String;
fileName : String;
fileName1 : LPCTSTR;
begin
fileName := 'uedit32.exe' ;
ProcID := GetProcByName(Pchar(fileName));
fileName1 := 'Inject.dll' ;
procResult := InjectDLL(ProcID,fileName);
TForm1.Edit1.text := inttostr(procResult)
end;
end;
==================下面是报的错=========
Build
[Error] Unit1.pas(48): Incompatible types: 'String' and 'PAnsiChar'
[Error] Unit1.pas(50): Method identifier expected
[Error] Unit1.pas(50): There is no overloaded version of 'IntToStr' that can be called with these arguments
[Error] Unit1.pas(55): '.' expected but ';' found
[Error] Unit1.pas(14): Unsatisfied forward or external declaration: 'TForm1.FormCreate'
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'
大家帮帮忙看看,错在那里了啊?
我是Delphi初学者,目前基本上对Delphi还是一窍不通。但我会努力学习的!