HomeSign in to retrieve your license keys and product download information.
 

 

  Products     SftPrintPreview/DLL 1.0     Free Trial     Support     Purchase     The product's printable manual for offline reference   Web-based help file (loads quickly but is less complete than the product's online help file)
 
 

Frequently Asked Questions

Q: When output is initially displayed, it takes quite a while and a small dialog is displayed saying "Formatting Page nn". Why are all pages formatted just to display the first page?

Normally, formatting all pages is not necessary, except when you use the %total% variable in a header or footer.  In order to render even the first page with a %total% variable, the total number of pages must be determined by formatting all pages.

Q: I have an MFC application. How do I use SftTree/DLL and SftPrintPreview/DLL without the view classes?

Even if you use C++/MFC, you do not have to use the CSftPrintPreview_View, CSftPrintPreview_Main and CSftPrintPreview_App classes.  These are optional, but provide some built-in functionality.  If your application doesn't use views, then of course you can't use these classes.

To use the tree control in your non-view based MFC application, you would follow these simple steps.

1.  Add the required support to your application as described in the online help topic "Using C++/MFC", including adding the control by creating it dynamically or on a dialog resource.  For first time users, we recommend that the control is placed on a dialog to become familiar with the product.

2. "Connect" the print preview control and the tree control.  This is described in the online help topic "SftTree/DLL and SftTree/OCX".  Since you are not using the view classes, you'll have to use the C sample (the C++ sample uses the view classes). So, you would use something like this:

SFTPRINTPREVIEW_CONTROL Ctl;
Ctl.cbSize = sizeof(SFTPRINTPREVIEW_CONTROL);
m_Tree1.GetControlInfo(&Ctl);
Ctl.lpDrawPageWorkArea = (SFTPRINTPREVIEW_DWORD_PTR) NULL;
Ctl.lpDrawInfoProc = NULL;          // no callback
Ctl.hwndContent = hwndTree;         // YOUR SFTTREE/DLL WINDOW
Ctl.hwndData = NULL;                // no data window 
// (content window is data window) if (!m_Tree1.SetControlInfo(&Ctl)) {     int errorValue = Ctl.errorValue;     _ASSERT(0); // an error occurred, check errorValue for error codes }

Basically, that's it.

Once this is up and running, you can incorporate mechanisms to switch between the tree control and the print preview control as needed by your application.  Our product can't really help you with this (that's why using the view classes helps, because there some of the functionality is built-in). You could use our C samples (not C++, since they use the view classes) for simple techniques.  The most common technique would be to hide the tree control and show the print preview control in its place (same size). To switch back, hide the print preview control and show the tree control. Don't forget to also disable a control when it's hidden.

Q: How do I change the header and footer fonts in my application?

Like most other customizations to the print preview control, these are performed using calls to Get/SetControlInfo.

To change the header and footer fonts, you would retrieve the current settings using GetControlInfo. Then you can update the hFontHeader, hFontFooter members in the SFTPRINTPREVIEW_CONTROL structure, followed by a call to SetControlInfo.

The font handles that you pass to the print preview control are owned by your application and must be deleted by your application once they are no longer needed. SftPrintPreview will not delete the font handles. A common mistake is that they are immediately deleted by your application. In that case the handles passed to the print preview control are invalid (and you won't get the result you want).  Particularly, when using C++, it's easy to make this mistake by using a local variable to hold the font object (CFont). The CFont object goes out of scope at the end of the function and the contained font handle is destroyed. Making such a CFont object a member of the parent window class will of course correct this. 

Q: I have a grid control. Can it be used with SftPrintPreview/DLL?

Probably not.  SftPrintPreview/DLL doesn't paint controls, it calls the control to do the work.  For this, mechanisms defined by SftPrintPreview/DLL 1.0 (SFTPRINTPREVIEW_CONTENTWINDOWMESSAGE) are used.  If the control implements these mechanisms, it will work with SftPrintPreview/OCX.  Presently, SftTree/DLL 5.0 (and newer) and SftTree/OCX 5.0 (and newer) support the required mechanisms.

Home

 

Product Info

Overview

Web Help

Manual (PDF)

Support

 

Free Demo

 

Purchase Now

 

Customer Info

My Account Login Required

License Keys Login Required

Download Products Login Required

Frequently Asked Questions