Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - CXTPReportControl within an CFormView
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPReportControl within an CFormView

 Post Reply Post Reply
Author
Message
FSauer View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2006
Location: Germany
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote FSauer Quote  Post ReplyReply Direct Link To This Post Topic: CXTPReportControl within an CFormView
    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?
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 21 October 2006 at 5:39pm
Hi,

try to include XTToolkitPro.rc in your rc2 file.

--
WBR,
Serge
Back to Top
FSauer View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2006
Location: Germany
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote FSauer Quote  Post ReplyReply Direct Link To This Post Posted: 23 October 2006 at 4:21am
Hi Serge.
 
Thank You, that's the solution.
 
 
Regards
Fabian
Back to Top
FSauer View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2006
Location: Germany
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote FSauer Quote  Post ReplyReply Direct Link To This Post 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
 
Back to Top
FSauer View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2006
Location: Germany
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote FSauer Quote  Post ReplyReply Direct Link To This Post 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);
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
FSauer View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2006
Location: Germany
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote FSauer Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.