From: Imóveis N. <imo...@gm...> - 2011-01-05 18:46:09
|
Hi all I have 2 applications compiled win mingw. One is a small and tester app and the other one is a big application. In both apps i call the PrintDlg function (windows) in order to show print dlg. In the small app it works and the printer dialog is shown but in the big application it returns error 0x1008 which means "A default printer does not exist." The error was catched using CommDlgExtendedError if(!PrintDlg(&dlg)) { DWORD x= CommDlgExtendedError(); Any Ideas? Thanks a lot Jose |
From: John B. <joh...@ho...> - 2011-01-05 23:57:53
|
Imóveis Nacionais <imoveisnacionais@...> writes: > > > Hi all > I have 2 applications compiled win mingw. One is a small and tester app > and the other one is a big application. In both apps i call the PrintDlg > function (windows) in order to show print dlg. In the small app it works > and the printer dialog is shown but in the big application it returns > error 0x1008 which means "A default printer does not exist." > > > > The error was catched using CommDlgExtendedError > > > > if(!PrintDlg(&dlg)) > { > DWORD x= CommDlgExtendedError(); > > Any Ideas?Thanks a lotJose > > I assume that both applications are running on the same computer. Did you initialise the PRINTDLG the same way in both applications? In particular the field for the structure size is very important. I would: ZeroMemory(&dlg, sizeof dlg); first, and then set the fields that I am interested in. Regards, John Brown. |
From: Imóveis N. <imo...@gm...> - 2011-01-06 21:23:42
|
Hello John. You truing helping me again! Thanks a lot! I am using MingW on windows, but this time I am using ultimate++ Lib. I already ask for help on Ultmate++ list but now answer :-( I am using a class called printjob in both projects: the small (tester) on and in the big one, like this: This is the complete source code for the small app: #include "teste2.h" teste2::teste2() { CtrlLayout(*this, "Window title"); btBut <<= THISBACK(OnBut); } void teste2::OnBut(void) { PrinterJob pj; bool b= pj.Execute(); //To open prn dlg if(!b) { DDUMP(GetLastErrorMessage()); Exclamation("Error"); } Draw& w = pj; w.StartPage(); w.DrawText(0, 0, "Hello world!", Roman(100)); w.EndPage(); } GUI_APP_MAIN { teste2().Run(); } It prints ok! On the big application I use: ... PrinterJob pj1("ABC"); bool b= pj1.Execute(); if(!b) { DDUMP(GetLastErrorMessage()); Exclamation("Error"); } Draw& w1 = pj1; w1.StartPage(); w1.DrawText(0, 0, "Hello world!", Roman(100)); w1.EndPage(); return; It gives the error 0x1008 which means "A default printer does not exist." Why it exists in the small project and not in the big one? Permissions? I am lost :-( Thanks again JoseB On Wed, Jan 5, 2011 at 11:57 PM, John Brown <joh...@ho...>wrote: > > Imóveis Nacionais <imoveisnacionais@...> writes: > > > > > > > Hi all > > I have 2 applications compiled win mingw. One is a small and tester app > > and the other one is a big application. In both apps i call the PrintDlg > > function (windows) in order to show print dlg. In the small app it works > > and the printer dialog is shown but in the big application it returns > > error 0x1008 which means "A default printer does not exist." > > > > > > > > The error was catched using CommDlgExtendedError > > > > > > > > if(!PrintDlg(&dlg)) > > { > > DWORD x= CommDlgExtendedError(); > > > > Any Ideas?Thanks a lotJose > > > > > > I assume that both applications are running on the same computer. > > Did you initialise the PRINTDLG the same way in both applications? > In particular the field for the structure size is very important. > I would: > > ZeroMemory(&dlg, sizeof dlg); > > first, and then set the fields that I am interested in. > > Regards, > John Brown. > > > > > ------------------------------------------------------------------------------ > Learn how Oracle Real Application Clusters (RAC) One Node allows customers > to consolidate database storage, standardize their database environment, > and, > should the need arise, upgrade to a full multi-node Oracle RAC database > without downtime or disruption > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > MinGW-users mailing list > Min...@li... > > This list observes the Etiquette found at > http://www.mingw.org/Mailing_Lists. > We ask that you be polite and do the same. Disregard for the list > etiquette may cause your account to be moderated. > > _______________________________________________ > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users > Also: mailto:min...@li...?subject=unsubscribe |
From: John B. <joh...@ho...> - 2011-01-07 07:50:42
|
Hello JoseB, The Ultimate++ people will have to help you with this one. Until then, you could try declaring your PrinterJob as PrinterJob pj1; // instead of PrinterJob pj1("ABC"); That is the only difference that I can see. Regards, John Brown. |
From: Imóveis N. <imo...@gm...> - 2011-01-07 10:24:27
|
I did that already... It seems a very stuppied problem... May me a operating system re-installation solves it. Thank you very much JoseB On Fri, Jan 7, 2011 at 7:50 AM, John Brown <joh...@ho...> wrote: > > Hello JoseB, > > The Ultimate++ people will have to help you with this one. > Until then, you could try declaring your PrinterJob as > PrinterJob pj1; // instead of PrinterJob pj1("ABC"); > > That is the only difference that I can see. > > Regards, > John Brown. > > > > > ------------------------------------------------------------------------------ > Gaining the trust of online customers is vital for the success of any > company > that requires sensitive data to be transmitted over the Web. Learn how to > best implement a security strategy that keeps consumers' information secure > and instills the confidence they need to proceed with transactions. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > MinGW-users mailing list > Min...@li... > > This list observes the Etiquette found at > http://www.mingw.org/Mailing_Lists. > We ask that you be polite and do the same. Disregard for the list > etiquette may cause your account to be moderated. > > _______________________________________________ > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users > Also: mailto:min...@li...?subject=unsubscribe > |