Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compiler error when adding crviewer to Delphi Project

Status
Not open for further replies.

merceng

Programmer
Jul 28, 2005
3
GB
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top