Hello All.
I have a problem adding the Crystal Reports crviewer ActiveX Control to a Delphi project.
I am using Crystal XI Developer and Delphi 7.
The problem occurs when I use the Import Type Library function to add the crviewer to the Delphi IDE.
When I try to compile it, I get the following compiler error:
[Error] CrystalActiveXReportViewerLib11_TLB.pas(2817): Type not allowed in OLE Automation call
The error occurs in the TCRVSelectionItem.Set_ObjectPosition procedure (see below).
Note also the warning regarding the type mismatch between the variables of the 'Get' and 'Set' functions.
function TCRVSelectionItem.Get_ObjectPosition(out pVal: tagRECT): HResult;
var
InterfaceVariant : OleVariant;
begin
InterfaceVariant := DefaultInterface;
Result := InterfaceVariant.ObjectPosition;
end;
function TCRVSelectionItem.Set_ObjectPosition(pVal: tagRECT): HResult;
{ Warning: The property ObjectPosition has a setter and a getter whose
types do not match. Delphi was unable to generate a property of
this sort and so is using a Variant as a passthrough. }
var
InterfaceVariant: OleVariant;
begin
InterfaceVariant := DefaultInterface;
InterfaceVariant.ObjectPosition := pVal; <= Error occurs on this line
Result := S_OK;
end;
If anyone has any suggestions as to how to overcome this, I would be really grateful.
Kindest regards,
Merceng
I have a problem adding the Crystal Reports crviewer ActiveX Control to a Delphi project.
I am using Crystal XI Developer and Delphi 7.
The problem occurs when I use the Import Type Library function to add the crviewer to the Delphi IDE.
When I try to compile it, I get the following compiler error:
[Error] CrystalActiveXReportViewerLib11_TLB.pas(2817): Type not allowed in OLE Automation call
The error occurs in the TCRVSelectionItem.Set_ObjectPosition procedure (see below).
Note also the warning regarding the type mismatch between the variables of the 'Get' and 'Set' functions.
function TCRVSelectionItem.Get_ObjectPosition(out pVal: tagRECT): HResult;
var
InterfaceVariant : OleVariant;
begin
InterfaceVariant := DefaultInterface;
Result := InterfaceVariant.ObjectPosition;
end;
function TCRVSelectionItem.Set_ObjectPosition(pVal: tagRECT): HResult;
{ Warning: The property ObjectPosition has a setter and a getter whose
types do not match. Delphi was unable to generate a property of
this sort and so is using a Variant as a passthrough. }
var
InterfaceVariant: OleVariant;
begin
InterfaceVariant := DefaultInterface;
InterfaceVariant.ObjectPosition := pVal; <= Error occurs on this line
Result := S_OK;
end;
If anyone has any suggestions as to how to overcome this, I would be really grateful.
Kindest regards,
Merceng