Problems with printing

Dear all

I have an application, which has been working without problems for the last
7 years. The application has some printing capabilities. Now, we have just
gotten a new printer (HP Laserjet CM4370), and when I try to print, my
application crashes. 

The app crashes in the print setup dialog even before I press OK. If I
select any other printer as default printer, the app doesn't crash. Then I
can show the print setup dialog without problems. But then, when I select
the CM4370, the app crashes again, even if I do not press OK.

Even if I choose to not show the print setup dialog, and just print
directly, the app crashes.


So, it sounds like a problem with the printer driver. The problem is,
however, that all other apps can print without problems, both our own apps
and all commercial apps, that I have tried.

So I have been trying to figure out, what distingueshes this one app of our
own from all the other. The only thing I can think of, is that this app
uses OLE DB for database access, while our other apps use DAO. Can this
have any impact?

When I compile my program, I get a warning saying "More than one global
threading model defined". Can this cause problems? And if so, how do I
correct it, so I only have one threading model?

I am really out of ideas, and I cannot really debug my program. When the
app crashes, it has jumpes to some illegal address, but it's the same
address every time (0x1B009B78).

Any help is greatly appreciated.

Cheers
Bjarne Nielsen
0
bnielsen (6)
3/14/2008 10:47:10 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
2267 Views

Similar Articles

[PageSpeed] 16

You might consider using the App Verifier to see if there is memory damage that is causing
this to fail, or if it is causing memory damage; this damage could be causing the problem,
which was previously unnoticed.

You need to report the problem to HP.  I have a lot of problems with HP's software, so I
don't buy HP equipment any longer.
					joe

On Fri, 14 Mar 2008 11:47:10 +0100, Bjarne Nielsen <bnielsen@post11.tele.dk> wrote:

>Dear all
>
>I have an application, which has been working without problems for the last
>7 years. The application has some printing capabilities. Now, we have just
>gotten a new printer (HP Laserjet CM4370), and when I try to print, my
>application crashes. 
>
>The app crashes in the print setup dialog even before I press OK. If I
>select any other printer as default printer, the app doesn't crash. Then I
>can show the print setup dialog without problems. But then, when I select
>the CM4370, the app crashes again, even if I do not press OK.
>
>Even if I choose to not show the print setup dialog, and just print
>directly, the app crashes.
>
>
>So, it sounds like a problem with the printer driver. The problem is,
>however, that all other apps can print without problems, both our own apps
>and all commercial apps, that I have tried.
>
>So I have been trying to figure out, what distingueshes this one app of our
>own from all the other. The only thing I can think of, is that this app
>uses OLE DB for database access, while our other apps use DAO. Can this
>have any impact?
>
>When I compile my program, I get a warning saying "More than one global
>threading model defined". Can this cause problems? And if so, how do I
>correct it, so I only have one threading model?
>
>I am really out of ideas, and I cannot really debug my program. When the
>app crashes, it has jumpes to some illegal address, but it's the same
>address every time (0x1B009B78).
>
>Any help is greatly appreciated.
>
>Cheers
>Bjarne Nielsen
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
3/14/2008 3:34:49 PM
On Fri, 14 Mar 2008 11:47:10 +0100, Bjarne Nielsen
<bnielsen@post11.tele.dk> wrote:

> Dear all
> 
> I have an application, which has been working without problems for the last
> 7 years. The application has some printing capabilities. Now, we have just
> gotten a new printer (HP Laserjet CM4370), and when I try to print, my
> application crashes. 
> 
> When I compile my program, I get a warning saying "More than one global
> threading model defined". Can this cause problems? And if so, how do I
> correct it, so I only have one threading model?

This sounds like the problem, if the device driver is a dll which you
load and is compiled with other run-time then your app -when you then
pass heap allocated data between dll and app you can get crashes.  Try
figuring out what switches were used for compiling the printer driver
- maybe you can get that info from HP if not from the driver itself.

hth/Anders.
--
A: People bitching about top-posting

> Q: What's the most annoying thing on USENET?
0
anders43 (7)
3/15/2008 11:05:26 AM
On Sat, 15 Mar 2008 19:05:26 +0800, Anders Karlsson wrote:

> On Fri, 14 Mar 2008 11:47:10 +0100, Bjarne Nielsen
> <bnielsen@post11.tele.dk> wrote:
> 
>> Dear all
>> 
>> I have an application, which has been working without problems for the last
>> 7 years. The application has some printing capabilities. Now, we have just
>> gotten a new printer (HP Laserjet CM4370), and when I try to print, my
>> application crashes. 
>> 
>> When I compile my program, I get a warning saying "More than one global
>> threading model defined". Can this cause problems? And if so, how do I
>> correct it, so I only have one threading model?
> 
> This sounds like the problem, if the device driver is a dll which you
> load and is compiled with other run-time then your app -when you then
> pass heap allocated data between dll and app you can get crashes.  Try
> figuring out what switches were used for compiling the printer driver
> - maybe you can get that info from HP if not from the driver itself.
> 
> hth/Anders.

Thanks for the suggestions Anders and Joe.

I found the problem, or at least I made the problem go away. I had a
feeling it had something to do with OLE DB as that is the only thing I
could find, that differentiates this one app from all the others. OLE DB
uses ATL, and in the app there was this machine generated code:

#if _WIN32_WINNT >= 0x0400
	HRESULT hRes = CoInitializeEx(NULL, COINIT_MULTITHREADED);
#else
	HRESULT hRes = CoInitialize(NULL);
#endif

I changed it to:
#if _WIN32_WINNT >= 0x0400
	HRESULT hRes = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
#else
	HRESULT hRes = CoInitialize(NULL);
#endif

and the problem went away. I'm not really sure what is going on, I am not
much of an ATL or COM guru, but it seems to have solved the problem, so I'm
happy. Just don't hope, it causes any other problems.

Cheers
Bjarne Nielsen
0
bnielsen (6)
3/17/2008 9:44:29 AM
Reply:

Similar Artilces:

Pivot Chart problems
This is a multi-part message in MIME format. ------=_NextPart_000_00B3_01C4E370.755D7D40 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable I have two issues with pivot charts. 1) I create a pivot table and chart with VB. I want thick lines on the = chart, so I do as follows: For i =3D 1 To .SeriesCollection.Count .SeriesCollection(i).Select With Selection.Border .Weight =3D xlThick End With Next This works great. However, upon selecting a Page Field value from the =...

Problem with the reconnection of a mailbox to a different user
Hello everybody, I have a problem with the reconnection of a mailbox, when I try to reconnect it to a different user. This is the scenario: 1) User A has a mailbox, I disconnect it. 2) Creation of User B 3) Reconnection of mailbox of user A to user B (I have tried not only with recovery center, but also directly through mailbox list section) No errors appears during theese steps, but when I try to create a new profile in outlook (I have created it only in the server, this is a test server), I see that the mailbox of user B (or the user B?) has not found! If I try to use Outlook Web Access, ...

Help needed to run macro
Argh!!! I think I may have created a macro to resolve an earlier problem, but when I try to run it I get... 'Macros in this workbook are disabled because the security level is high, and the macros have not been digitally signed or verified. To run the macros, you can either have them signed or change your security level.' How can I get my macros to run on my machine, where they are created, without compromising security? I've found and run selfcert.exe but it hasn't made any difference. Do I need to do anything else to make this effective? I'm a novice at this so step ...

Problem sending e-mails with Outlook & SBC Yahoo DSL
I have been unable to fix a problem and am looking for help. I have Outlook 2000. I also have SBC Yahoo DSL. I have spent hours on the phone trying to fix this problem, reloaded my software, etc. I can recieve e-mail from the SBC Yahoo DSL server with my Outlook, but cannot send e- mails. The error message I get is 0x800ccc0f. I know this means the outgoing mail server does not recognize and log me in, but does anyone know a way to change this? SBC made sure my settings were correct, but the problem persists. They claim it is an Outlook problem, but it never happened with other ISP...

2005 Update Retirement Account Problem
I am having the same problem as discussed in a post on 10/5. Has anyone else seen this or know of a solution? And btw, I am not running XP SP2, just a fully updated SP1 system. I tried everything I could find in the KB to no avail as well. I am getting really frustrated with how many bugs there are in 2005. I have used MS Money for years and have never had as many problems as I have with 2005. I can't believe that this product made it out to the public with as many problems as there are. Any comments would be appreciated. ...

Problem sending emails from Outlook Express Ver6 NEVER MIND!
I am trying to use Outlook Express Ver6 instead of Eudora. I can't seem to send e-mails from it. When I send a test to myself I get the error: The message could not be sent because the server rejected the sender's e-mail address. The sender's e-mail address was (MY ADDRESS) .. Subject 'TEST', Account: 'incoming.verizon.net', Server: 'outgoing.verizon.net', Protocol: SMTP, Server Response: '550 5.7.1 Authentication Required', Port: 25, Secure(SSL): No, Server Error: 550, Error Number: 0x800CCC78 Can anyone suggest what is wrong? Must be something...

Printing in equal thirds to perfed paper
I have a 3 up form that I have designed and I want to have it print in equal 1/3'rds on a single 8.5x11.0 page. Is there a way to set this without playing with different row heights to make it fit? ...

Problems importing pst file...
One of the users in our office tried to open Outlook & recieved an error message that indicated that the pst was gone or corrupt. After running the Inbox repair tool to no avail, as well as picking up a copy of their pst from yesterday's backup, I'm still unable to do anything with it! When trying to import it, I get the message "Properties for this information service must be defined prior to use" & after hitting ok, I get a message that the file isn't a personal folders file! I have read several long-winded posts in other forums, which basically have given me no...

Problem of space between items in SMALLICON mode
Hi, I have problem with spacing between items in LVS_SMALLICON list mode. Some that have long text hide the others. Not when i'm changing mode, just when I change data in my list. I use SetWindowLong to change list mode, and tried list.Arrange, list.redraw and list.update functions with no success. Actually, list doesn't change space between items when I change data in my list. I browsed the group, and found some unanswered subject about the same problem, so if someone could help me it would be cool. TIA. Have you tried the CListCtrl::SetIconSpacing before CListCtrl::Arrange? Vict...

Outlook / Exchange 2003 user connection problem
Ok, we are doing our Outlook configuration in a two step process first we add the Computer to the domain ( not the user ). Then we configure Outlook with the exchange server and user information. All of our users are created and have a default password. Problem is that when we go to setup Outlook we are only able to setup 2 - 5 computers a day. After we get 2 - 5 setup, when we try to install/configue another Outlook client we receive a message that say Cannot connect to Exchange server or Exchange server does not exist. But if we wait a day and go back to setting up Outlook again we are ab...

Problem with a MIN function
Hi all Please can someone explain to me why this doesn't work: =MIN((A46:A52>0)*(A46:A52+B46:B52)) array-entered I've got dates in both ranges - and both ranges also contain blanks. I don't understand why this formula does not return what I want!! I'm trying to get the earliest date in A46:A52 where there is a blank in the corresponding cell in B46:B52. I've checked the formula (including the F9 option in the formula bar to view each part) and it's got me beat! -- Andy. Hi try the arraz formula =MIN(IF((A46:A52>0)*(B46:B52=""),A46:A52)) >---...

LABELS
This is beyond me! I am using commercial labels (pre-glued). I find that with the given Top Margin, they are printed too far up the page and so overlap the top edge of the labels. To remedy this, I have tried adding an extra few mm on the Top Margin. Even though the Print Preview shows it lowered it does not print lower!! (Publisher is lying to me.) Assistance will be gratefully appreciated. petsalnews petsalnews <petsalnews@xtra.co.nz> was very recently heard to utter: > This is beyond me! I am using commercial labels (pre-glued). I find > that with the given Top Margi...

printing large high quality pictures
I am wanting to print large high quality prints using pub 2000, I get a message that the pics are too large, so I convert to jpg and then further, I have to convert to high compression to print my pics. Should I use another program to print high quality poster (and larger prints) and what are the alternative software programs available? with thanks, Grant. With Pub2000 you have a 16mb limitation for each photo and all photos are treated as uncompressed bitmaps. Pub2002 is a little better and Pub2003 has fairly well resolved this limitation. You may find that other applications work...

Printing in booklet setup
I have a job that is sent to me in a booklet form. It shows the corners folded over on the pages along the bottom of publisher. I've tried in the past to use this mode to print a booklet but I've had no success. It always prints off letter pages of if I pick 11x17 sheet size, it reduces the size and just doesn't print it properly. The page size is 8.5 x 11 and I want to print onto 11 x 17 then fold. Your printer will determine where the fold will be. Look at your printer settings, it will say something like *Flip pages up* or there will be options about binding. If the pa...

Outlook2007 automation problem with ".Display"
I am using automation in a VB5 program to send Emails using Outlook2007. If I use the ".Send" mailitem the email is sent out Immediately. If I use the ".Display" mailitem in my program, after I look over the Email and then click the "Send" button on the Outlook display screen, the email is placed in my outbox but does not get sent out. I have to exit my program and then click "Outlook". When Outlook displays, I can see the Email in the Outbox which will then automatically go out (without me having to click send and receive). I want th...

masters and printing booklet
I'm having trouble printing an 8 page booklet in Publisher 2003 that has different masters for the front and back. Are the masters the problem? Should I uncheck two page spread to make it print right? Thanks for help! Have you tried printing the way you state? If you go to your back cover and print current page and click no, does it print okay. You might get some insight by reading this: About using master pages http://office.microsoft.com/en-us/assistance/HP010036031033.aspx -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "...

Calender Problem after Exchange Migration
Hi all, I've got a bit of a Exch Calendar problem. We recently migrated from Exch2000 Srv to Exch2003 Srv. We also changed domain names (AD and company) as well. Due to time constraints and other issues I won't go into, things were a little rushed and the way we did the migration was probably not by the MS rules. Basically we restored a backup of the mailboxes from the old Exch2000 server to the new Exch2003 server. This was done via Qinetix MB idata agent. We thought this would be quicker than exporting the mailbox's out as PST files and then importing them. This part app...

Autonumber problem
Hi, I have a problem with autonumber field in my project: when I deleted some last records, it seems MS Access saved the last number of the autonumber. So when I added a new record, the number would be skipped from the previous record. I'd like the next record will be in order from the previous record in my outonumber field. Is anybody can tell me how to solve this problem?. Thanks... KT -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200707/1 If the value of the autonumber actually matters then you shouldn't be using atuonu...

Mac problems opening excel files when connected to two windows shares
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I'm noticing a strange problem when I try to open excel files when I connect to a second windows server share. I'm getting a cannot open excel file error. Not sitting at my work mac computer at the moment so not quite sure that was the exact error. <br><br>This error is occuring on both leopard and snow leopard with Office 2008 for mac. <br><br>The two windows servers are being connected to by smb://server1/common and smb://server2/common. <br><br>If i connect to each one i...

Cannot "Print Each Item On New Page"
When selecting "Memo Style" from the print styles dialouge the "Print each item on new page" is grayed out. I'm currently using Outlook 2003. Help! -ANDY ...

How can set up Excel to be able to print checks?
I wish to be able to build a template so I can print checks from an excel program. This file might be a help: http://www.bygsoftware.com/examples/zipfiles/num2wrds.zip It's in the "Accountants" section on page: http://www.bygsoftware.com/examples/examples.htm It contains the "SPELLNUMBER" function, which can be used in your spreadsheets, two methods to convert numbers to words and two cheque writing routines. The code is open and commented. -- Andy Wiggins FCCA www.BygSoftware.com Excel, Access and VBA Consultancy - "catherine" <catherine@discussio...

Void Deferral Transactions Problem
I am having a problem voiding some deferred transactions. I entered the transactions through Receivables Management. I can see these transactions under the customers in the Deferral Inquiry window. However, they do not show up in the Void Deferral Transactions window for me to void. Some other transactions entered the same way in the same batch as these but under different customers do show up. Cannot figure out why that would be. I have tried check links and deferral check links to no avail. Any suggestions? Thanks! Paul ...

some problems with OL 2007
Hi, I have used OL XP (2002) for years and I was very happy. But some friends convince me I should be more "modern" so I installed Office 2007, with Win XP SP4. It seems very complicated to me, but I have problems with Outlook. My emails don't download "normally", I have to close OL and reopen it (of course before, I did a send/receive and there was no email), not always though, sometimes they download. To prevent your next question, they are mail that should have been in my inbox for some time (a few hours). Also I don't get an alert. "Before" I ...

Problem: creating memory CDC for drawing and saving into BMP object in different color mode
Definition of problem: 1. I have some function Draw(CDC* dc) for drawing smth on CDC object. The body of function is "black box", I won't change it. 2. I need draw it into memory CDC object. Well, following code will do it for me: CDC mydc; mydc.CreateCompatibleDC(pDC); // pDC is some display DC CBitmap m_bitmap; m_bitmap.CreateCompatibleBitmap(mydc, width, height); // <- creating an internal bitmap CBitmap* m_pOldBitmap = dc.SelectObject(&m_bitmap); Draw(&mydc); // draw scene ........ do smth with mydc ...... if (m_pOldBitmap) mydc.SelectObject(m_pOldBitmap); The...

Printing business cards #11
I've created my business cards in Pub. 2002 and print preview shows everything perfectly. However, when I print each row seems to print a little too hgih into the next until finally the last row of cards has a .25 inch gap at the bottom. Seemed to me it might be a feed problem with my printer, but I printed a test page and it was not skewed. I even tried adjusting ( in Pg Setup) the vertical gap between the rows and that moves the printing too much. Hope my rambles make sense. I've been messing w/ this off and on for 3 days now. -- Thank you, Christine It does sound like ...