|  | 
| CXTPReportControl within an CFormView | 
| Post Reply   | 
| Author | |
| FSauer   Groupie     Joined: 10 May 2006 Location: Germany Status: Offline Points: 96 |  Post Options  Thanks(0)  Quote  Reply  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? | |
|  | |
| sserge   Moderator Group   Joined: 01 December 2004 Status: Offline Points: 1297 |  Post Options  Thanks(0)  Quote  Reply  Posted: 21 October 2006 at 5:39pm | 
| 
   Hi, try to include XTToolkitPro.rc in your rc2 file. -- WBR, Serge | |
|  | |
| FSauer   Groupie     Joined: 10 May 2006 Location: Germany Status: Offline Points: 96 |  Post Options  Thanks(0)  Quote  Reply  Posted: 23 October 2006 at 4:21am | 
| 
   Hi Serge.
 Thank You, that's the solution.  Regards  Fabian | |
|  | |
| FSauer   Groupie     Joined: 10 May 2006 Location: Germany Status: Offline Points: 96 |  Post Options  Thanks(0)  Quote  Reply  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 Handleint CSLinkSDIApp::ExitInstance() { m_ResourceManager->Close(); return CWinApp::ExitInstance(); } Regards Fabian | |
|  | |
| FSauer   Groupie     Joined: 10 May 2006 Location: Germany Status: Offline Points: 96 |  Post Options  Thanks(0)  Quote  Reply  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); | |
|  | |
| Oleg   Senior Member   Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |  Post Options  Thanks(0)  Quote  Reply  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 | |
|  | |
| FSauer   Groupie     Joined: 10 May 2006 Location: Germany Status: Offline Points: 96 |  Post Options  Thanks(0)  Quote  Reply  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 | |
|  | |
| Post Reply   | |
| Tweet | 
| Forum Jump | Forum Permissions  You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |