Print Page | Close Window

CXTPReportControl within an CFormView

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=5313
Printed Date: 18 May 2024 at 3:38am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPReportControl within an CFormView
Posted By: FSauer
Subject: CXTPReportControl within an CFormView
Date Posted: 18 October 2006 at 7:33am
Hi.
I use a CXTPReportControl within an CFormView.
 
Its working fine, while my project is dynamically linking to the MFC Library. But if my project is statically linking to the MFC-Library its failed.
 
The failure is at runtime: "Debug Assertion Failed! ... File: ...\XTPReportPaintManager.cpp" ->line: 103 ...."
 
For a Test I create an SDI-Project and declare an instance of CXTPReportControl in the Class based on CFormView (static link Library). I get the same failure. And than with a dynamic link Library, its working fine.
 
Can anybody help me, Have i forgotten anything?



Replies:
Posted By: sserge
Date Posted: 21 October 2006 at 5:39pm
Hi,

try to include XTToolkitPro.rc in your rc2 file.

--
WBR,
Serge


Posted By: FSauer
Date Posted: 23 October 2006 at 4:21am
Hi Serge.
 
Thank You, that's the solution.
 
 
Regards
Fabian


Posted By: FSauer
Date Posted: 23 October 2006 at 5:43am
Hello.
The include in the rc2 File (#include <XTToolkitPro.rc>) is a solution for MDI or Dialog Based Apllications, but for the SDI-Applications I had problems. So I use the code below, that's work correctly:
 
//Create a instance of CXTPResourceManager in the CWinApp Based Class:
class CSLinkSDIApp : public CWinApp
{
public:
 CSLinkSDIApp();
 CXTPResourceManager* m_ResourceManager;
...}
 
//Initialize the Instance
CSLinkSDIApp::CSLinkSDIApp()
{
 m_ResourceManager = new CXTPResourceManager();
}
//Set ResourceFile befor create instanc of CSingleDocTemplate
BOOL CSLinkSDIApp::InitInstance()
{
...
 m_ResourceManager->SetResourceFile("C:\\WINNT\\system32\\ToolkitPro1010vc60D.dll");
 CSingleDocTemplate* pDocTemplate;
...}
 
 
//Don't forget to Close the Handle
int CSLinkSDIApp::ExitInstance()
{
 m_ResourceManager->Close();
 return CWinApp::ExitInstance();
}
 
Regards
Fabian
 


Posted By: FSauer
Date Posted: 24 October 2006 at 4:21am
 CString strSystemPath = _T("");
 TCHAR szSysDirectory[100];
 int i=GetSystemDirectory(szSysDirectory,100);
 strSystemPath.Format("%s\\ToolkitPro1010vc60D.dll",szSysDirectory);
 m_ResourceManager->SetResourceFile(strSystemPath);


Posted By: Oleg
Date Posted: 24 October 2006 at 6:33am
Hi,
 
Must work. If you use MFC statically, ToolkitPro will link statically also, so you don't need ToolkitPro1010vc60D file at all. ( you can not destribute it)
 
you can delete it and also try to add
XTPResourceManager()->SetResourceHandle(AfxGetInstanceHandle()); in App::InitInstasnce.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: FSauer
Date Posted: 21 February 2007 at 6:58am

Hi Oleg.

Thank You for your participation.

Solution 1:
 CString strSystemPath = _T("");
 TCHAR szSysDirectory[100];
 int i=GetSystemDirectory(szSysDirectory,100);
 strSystemPath.Format("%s\\ToolkitPro1010vc60D.dll",szSysDirectory);
 m_ResourceManager->SetResourceFile(strSystemPath);
 
Solution 2:
XTPResourceManager()->SetResourceHandle(AfxGetInstanceHandle());
I tried it (Solution 2), but it didn't work with a statically linking Project (SDI).
 
So, I'm using beyond the solution 1.
 
Best Regards
FSauer



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net