Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CExtPPVW_Printable::_PrintingDialog Problem Collapse All
Subject Author Date
Michael Valentine Apr 16, 2007 - 10:36 AM

Hi, I have just added printing support to our property grid using the CExtPPVW template, as demonstrated in the CompoundProperties sample. Print preview works fine, but when I try to print I get a crash. After investigating this it seems that the CExtPPVW_Printable::_PrintingDialog fails to get created. The line that fails is:

HINSTANCE hInst =
    g_ResourceManager->FindResourceHandle(
        RT_DIALOG,
        UINT(LPCTSTR(lpszTemplateName)),
        NULL,
        &hResource
        );

This gets called with an ID of _PrintingDialog::IDD (30722), however this does not exist or is not registered correctly.

Any ideas how I can resolve this? I am linking to the Prof-UIS libs statically if that makes a difference. My property grid is derived from the standard one in this format:

class CPropertyGridCtrl : public CExtPPVW < CExtPropertyGridCtrl >

I also use our own toolbar, derived from CExtPropertyGridComboBoxBar and add the print buttons manually (along with some of our own). In a derived version of OnPgcCreateBars. I have made sure that all references to base class functions are referenced as such:

CExtPPVW < CExtPropertyGridCtrl > ::OnTimer(nIDEvent);

The callstack is:

>    CExtResDlg::Create(const char * lpszTemplateName=0x00007802, CWnd * pParentWnd=0x028634f4) Line 5930    C++
    CExtResDlg::Create(unsigned int nIDTemplate=30722, CWnd * pParentWnd=0x028634f4) Line 5946    C++
    CExtPPVW_Printable::_PrintingDialog::_PrintingDialog(CWnd * pParent=0x028634f4) Line 788    C++
    CExtPPVW_Printable::DoPrintDoc() Line 1079    C++
    CExtPPVW_Printable::DoPrintPreview(bool bPreviewMode=false, bool bDirectMode=false, CRuntimeClass * pPreviewViewClass=0x016dac14, CPrintPreviewState * pState=0x031a4de8) Line 1004    C++
    CExtPPVW<CExtPropertyGridCtrl>::OnCmdMsg(unsigned int nID=30576, int nCode=0, void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000) Line 6488    C++
    CWnd::OnCommand(unsigned int wParam=30576, long lParam=0) Line 2300    C++
    CWnd::OnWndMsg(unsigned int message=273, unsigned int wParam=30576, long lParam=0, long * pResult=0x0012e8a4) Line 1755    C++
    CWnd::WindowProc(unsigned int message=273, unsigned int wParam=30576, long lParam=0) Line 1741    C++
    CExtPropertyGridCtrl::WindowProc(unsigned int message=273, unsigned int wParam=30576, long lParam=0) Line 9260    C++
    CExtPPVW_Base<CExtPropertyGridCtrl>::WindowProc(unsigned int message=273, unsigned int wParam=30576, long lParam=0) Line 651    C++
    CExtPPVW<CExtPropertyGridCtrl>::WindowProc(unsigned int message=273, unsigned int wParam=30576, long lParam=0) Line 6649    C++
    AfxCallWndProc(CWnd * pWnd=0x028634f4, HWND__ * hWnd=0x00231292, unsigned int nMsg=273, unsigned int wParam=30576, long lParam=0) Line 240    C++
    AfxWndProc(HWND__ * hWnd=0x00231292, unsigned int nMsg=273, unsigned int wParam=30576, long lParam=0) Line 389    C++


Thanks in advance for your help.

Technical Support Apr 16, 2007 - 12:46 PM

There is not enough information to come to any conclusion about why the printing status dialog resource cannot be found. Please try commenting some parts of code of your property grid class and find a configuration when the problem is resolved. Please also let us know whether your application uses any preferred locale feature of the resource manager like demonstrated in the LanguageSwitcher sample application? You can also send us your project so we can figure out what’s wrong.

Michael Valentine Apr 17, 2007 - 3:32 AM

I have already tried commenting out bits of code and I cannot solve this. And no we do no use any preferred locale feature. I will send you a small test application that demonstrates the same problem...