안녕하세요....
델파이를 이제 시작하는 초보입니다....
dll에 파일을 로드 해야 되는데 에러가 발생하네요....
[Error]WinForm.pas(43):Unsafe pointer variables, parameters or consts only allowed in unsafe procedure
위가 에러 내용입니다.
따로 dll 파일을 연결을 시켜주야 하는가요...
dll파일 연결하는 방법을 좀 알고 싶습니다..
제가 아직 많이 부족해서...예제가 좀 있었으면 합니다..
부탁드립니다..
즐거운 하루 되세요.
아래는 소스 코드입니다.
unit WinForm;
interface
uses
System.Drawing, System.Collections, System.ComponentModel,
System.Windows.Forms, System.Data;
type
TWinForm = class(System.Windows.Forms.Form)
{$REGION 'Designer Managed Code'}
strict private
/// <summary>
/// Required designer variable.
/// </summary>
Components: System.ComponentModel.Container;
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure InitializeComponent;
{$ENDREGION}
strict protected
/// <summary>
/// Clean up any resources being used.
/// </summary>
procedure Dispose(Disposing: Boolean); override;
private
{ Private Declarations }
public
constructor Create;
end;
[assembly: RuntimeRequiredAttribute(TypeOf(TWinForm))]
implementation
const OK = 0;
const FAIL = -1;
//*****************************************
// DLL함수의 정적로드를 위한 선언
//*****************************************
function RFReaderOpen(ComportName : PChar) : Integer; stdcall; external 'RFUsing.dll';
{$REGION 'Windows Form Designer generated code'}
/// <summary>
/// Required method for Designer support -- do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure TWinForm.InitializeComponent;
begin
Self.Components := System.ComponentModel.Container.Create;
Self.Size := System.Drawing.Size.Create(300, 300);
Self.Text := 'WinForm';
end;
{$ENDREGION}
procedure TWinForm.Dispose(Disposing: Boolean);
begin
if Disposing then
begin
if Components <> nil then
Components.Dispose();
end;
inherited Dispose(Disposing);
end;
constructor TWinForm.Create;
begin
inherited Create;
//
// Required for Windows Form Designer support
//
InitializeComponent;
//
// TODO: Add any constructor code after InitializeComponent call
//
end;
end.