I developed an application under Visual Studio 2005 using Crystal Reports XI. If I installed it under Windows 7, reporting worked fine. Now I changed to Visual Studio 2010, still using Crystal Reports XI. If I install my application under Windows 7, direct printing works still fine but the print preview crashes if I create the report viewer with CreateControl(…).
class CCrystalReportViewer11 : public CWnd
{
protected:
DECLARE_DYNCREATE(CCrystalReportViewer11)
public:
CLSID const& GetClsid()
{
static CLSID const clsid = { 0x460324E8, 0xCFB4, 0x4357, { 0x85, 0xEF, 0xCE, 0x3E, 0xBF, 0xE2, 0x3A, 0x62 } };
return clsid;
}
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect, CWnd* pParentWnd, UINT nID,
CCreateContext* pContext = NULL)
{
return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID);
}
I know that Crystal reports XI is installed on the Windows 7 machine and also can find CLSID {460324E8-CFB4-4357-85EF-CE3EBFE23A62} in its registry.
To anybody know, what’s going wrong ?