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!

Ole Objects (Crystal Reports)

Status
Not open for further replies.

makaveliuk

Programmer
Dec 1, 2003
46
GB
Hi,

I am trying to open a Crystal Report using CRAXDDRT20.dll from Crystal Reports .NET, I am using the code:

HRESULT hr = NULL;
IApplicationPtr Crystal;
IReportPtr rep;

hr = Crystal.CreateInstance("CRYSTALRUNTIME.APPLICATION");

rep = Crystal->OpenReport(report->CString());

But it fails at the point of CreateInstance(.....);

The hr result returned is -2147221005 which I believe means Invalid Class String.

Does anyone have any ideas where I'm going wrong?
 
Hello

I think it's because the CoCreateInstance function (which is called by CreateInstance Method) hasn't detected your library.
You must verify in your registry (reggedit) that the value of CRYSTALRUNTIME.APPLICATION refers correctly to the CLSID of the object you want to create.
Then you must verify at the CLSID key contains the good and full path which localize th DLL.
At last, be sure the report->CString() value is correct.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top