GetDefaultPrinter Call does not compile [message #30207] |
Wed, 15 December 2010 16:20  |
JoseB
Messages: 37 Registered: March 2009
|
Member |
|
|
Please, could you help me compilling this little example app:
#include <CtrlLib/CtrlLib.h>
#include <winspool.h>
using namespace Upp;
struct MyAppWindow : TopWindow
{
virtual void Paint(Draw& w)
{
w.DrawRect(GetSize(), SWhite);
w.DrawText(20, 20, "Hello world!", Arial(30), Magenta);
}
MyAppWindow()
{
Title("My application").Zoomable().Sizeable();
char szPrinterName[255];
unsigned long lPrinterNameLentgth;
int ret=GetDefaultPrinter(szPrinterName,&lPrinterNameLentgth );
if(ret==0)
{
DWORD dwErr = ::GetLastError();
char e[100];
sprintf(e,"%d",dwErr);
MessageBox(NULL, "GetDefaultPrinter Error", e,MB_ICONINFORMATION);
}
}
};
GUI_APP_MAIN
{
MyAppWindow app;
app.SetRect(0, 0, 200, 100);
app.Run();
}
The compiler says:
C:\upp\MyApps\ppp\main.cpp: In constructor 'MyAppWindow::MyAppWindow()':
C:\upp\MyApps\ppp\main.cpp:21: error: 'GetDefaultPrinterA' was not declared in this scope
C:\upp\MyApps\ppp\main.cpp:29: error: returning a value from a constructor
This is just a test application.
Thank you
JoseB
[Updated on: Wed, 15 December 2010 16:22] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|