读书人

CreateDC有关问题

发布时间: 2012-02-22 19:36:55 作者: rapoo

CreateDC问题
hPrinter = CreateDC( TEXT( "oki.dll "), NULL, TEXT( "LPT1: "), &DevMode );
error126,找不到指定的模块名,即找不到oki.dll,但是我机器里面是有这个DLL的
哪位大虾有遇到过这种问题的啊

[解决办法]
HDC CreateDC(
LPCTSTR lpszDriver, // driver name
LPCTSTR lpszDevice, // device name
LPCTSTR lpszOutput, // not used; should be NULL
CONST DEVMODE *lpInitData // optional printer data
);

lpszDevice
[in] Pointer to a null-terminated character string that specifies the name of the specific output device being used, as shown by the Print Manager (for example, Epson FX-80). It is not the printer model name. The lpszDevice parameter must be used.
[解决办法]

hPrinter = CreateDC( TEXT( "oki.dll "), TEXT( "LPT1: "), NULL, &DevMode );
[解决办法]
#pragma comment(lib, "gdi32.lib ")

读书人网 >C++

热点推荐