A
akosboy
Unregistered / Unconfirmed
GUEST, unregistred user!
一个DLL中这样定义:
// *********************************************************************//
// Interface: IMpRect
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {9009B37F-9FAC-413B-B874-9CCCA0E7AA64}
// *********************************************************************//
IMpRect = interface(IDispatch)
['{9009B37F-9FAC-413B-B874-9CCCA0E7AA64}']
function Get_xmin: Double; safecall;
procedure Set_xmin(pVal: Double); safecall;
function Get_ymin: Double; safecall;
procedure Set_ymin(pVal: Double); safecall;
function Get_xmax: Double; safecall;
procedure Set_xmax(pVal: Double); safecall;
function Get_ymax: Double; safecall;
procedure Set_ymax(pVal: Double); safecall;
procedure Set_(xmin: Double; ymin: Double; xmax: Double; ymax: Double); safecall;
property xmin: Double read Get_xmin write Set_xmin;
property ymin: Double read Get_ymin write Set_ymin;
property xmax: Double read Get_xmax write Set_xmax;
property ymax: Double read Get_ymax write Set_ymax;
end;
*************************************************************
在程序中这样使用:
var
MyRect:IMpRect;
begin
MyRect.Set_xmin(1.0);
MyRect.Set_xMax(2.0);
MyRect.Set_ymin(1.0);
MyRect.Set_ymax(2.0);
**************************************
结果编译没有错误,但程序执行出现如下提示:
Access violation at address 00416618C in module 'Project1.exe'.Read of address 000000.
我刚学用DELPHI,这个问题不知道是因为什么情况造成的,请各位达人指点。
// *********************************************************************//
// Interface: IMpRect
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {9009B37F-9FAC-413B-B874-9CCCA0E7AA64}
// *********************************************************************//
IMpRect = interface(IDispatch)
['{9009B37F-9FAC-413B-B874-9CCCA0E7AA64}']
function Get_xmin: Double; safecall;
procedure Set_xmin(pVal: Double); safecall;
function Get_ymin: Double; safecall;
procedure Set_ymin(pVal: Double); safecall;
function Get_xmax: Double; safecall;
procedure Set_xmax(pVal: Double); safecall;
function Get_ymax: Double; safecall;
procedure Set_ymax(pVal: Double); safecall;
procedure Set_(xmin: Double; ymin: Double; xmax: Double; ymax: Double); safecall;
property xmin: Double read Get_xmin write Set_xmin;
property ymin: Double read Get_ymin write Set_ymin;
property xmax: Double read Get_xmax write Set_xmax;
property ymax: Double read Get_ymax write Set_ymax;
end;
*************************************************************
在程序中这样使用:
var
MyRect:IMpRect;
begin
MyRect.Set_xmin(1.0);
MyRect.Set_xMax(2.0);
MyRect.Set_ymin(1.0);
MyRect.Set_ymax(2.0);
**************************************
结果编译没有错误,但程序执行出现如下提示:
Access violation at address 00416618C in module 'Project1.exe'.Read of address 000000.
我刚学用DELPHI,这个问题不知道是因为什么情况造成的,请各位达人指点。