Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

OWL/DLL/COM printing problem

Posted on 1999-01-27
8
Medium Priority
?
200 Views
Last Modified: 2013-12-26
I have developed an ActiveX, COM based DLL as a component to medical billing systems.  The component includes interface functions which get and send back information and functions which display dialogs for information and selection.  Everything works fine except printing.  In some of the dialogs I allow the user to choose 'Print' to print certain list box information.  However, when I choose Print the "Print Setup" dialog appears and works with no problem.  The TPrintout seems to be built with no problems.  But, when the DLL actually attempts to print the dialog closes down and I am brought directly back to the calling program.

Some Facts:
1. Using Borland C++ 5.2
2. I am able to print from the EXE program.
3. I am positive TPrintout is not the problem since I have tried simplifying it to just 1 or two lines of text but get the same print problem.

Thanks for any help,
Greg Marston, Unicor Medical
0
Comment
Question by:gmarston
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1299861
Is this 16bit or 32bit?

0
 

Author Comment

by:gmarston
ID: 1299862
32bit.
0
 

Expert Comment

by:kralubo
ID: 1299863
Did you load in your DLL the (Print) Windows Common Controls (in your exe they may be linked automatically)?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:gmarston
ID: 1299864
I'm guessing you mean the file owl/printer.h?  If so, the answer is no and I'm feeling pretty stupid. I'll try this out asap and let you know. Thanks
0
 

Author Comment

by:gmarston
ID: 1299865
Ignore the previous comment from me.  I'm not sure if I loaded the Print common controls in the DLL.  How do I determine this?
0
 
LVL 1

Expert Comment

by:kjetilr
ID: 1299866
Did you remember to include the printer.rc file? This is a bit important in OWL.
0
 

Author Comment

by:gmarston
ID: 1299867
Here's a snippet of the relevant code.  The fact that
"Printer->Setup(this)" works should mean the window's print controls are all there for owl.  Correct?


TPrinter *Printer;

Printer = new TPrinter;


....called from a dialog (from DLL) when user selects print:

  if (Printer) {
    DListPrintout po((char *)m_lbdata[m_current].notes1.c_str(),
          m_listbox, Printer);
    // TPrintout derived class, same class works,
    // with EXE but not in DLL.

    message((char *)po.GetTitle());
    // this works fine, po is okay

    Printer->Setup(this);
    // a test to see if Printer is brings up
    // dialog and correct default
    // printer (should mean everything okay)

    Printer->Print(this, po, TRUE);
    // 1. brings up Print dialog to select
    //    different printer.
    // 2. SetPrintParams is called because
    //    message is displayed
    // 3. nothing prints and component dialog
    //    closes, returns to calling .exe

Thanks for any help,
Greg
0
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 300 total points
ID: 1299868
I don't see any reason for this, but for expeance, can be
that Print notpPrinted (in BC 4.x,5.x)! In this case i make
roundabout way: simply print with help pure Windows
functions: OpenPrint,OpenDoc,...(see Windows Doc).
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question