阅读:1001回复:4
关于98下打印机驱动的Control函数?
谁能给我点98下的打印机驱动开发的资料,各种函数的用法等,DDK上好象没有啊,拜托大家啦,我是新人,请大家多多关照!
主要是各种如Control,enable,disable等的用法的资料,如果可以的话,高分相送,拜托啦 :) |
|
|
沙发#
发布于:2005-01-14 14:23
详见98DDk
Control WORD Control( LPPDEVICE lpDestDev, WORD wFunction, LPSTR lpInData, LPSTR lpOutData ); Carries out the device-specific extension specified by the wFunction parameter. Depends on the escape function specified by the wFunction parameter. In general, positive values indicate success, negative values indicate an error, and zero can indicate either an unimplemented escape or a general error condition. lpDestDev Address of a PDEVICE structure that specifies the destination device. wFunction Escape to carry out. Although the number of wFunction values and the meaning of each value depends on the driver, GDI reserves a number of values to specify predefined escapes. lpInData Address of escape-specific input data. lpOutData Address of escape-specific output data. The export ordinal for this function is 3. GDI calls Control when an application calls the Escape function (GDI.38). For this reason, the device-specific extensions are also called escapes. Every graphics driver must export a Control function. The Control function should always return zero for escapes that are unimplemented or unrecognized. The function should return the number of bytes copied if it copies data to a buffer pointed to by the lpOutData parameter, or if the lpOutData parameter is NULL, it should return the size in bytes of the buffer it requires to copy data. GDI modifies some escapes before calling the Control function. Enable WORD Enable( LPVOID lpDevInfo, WORD wAction, LPSTR lpDestDevType, LPSTR lpOutputFile, LPVOID lpData ); Initializes software and hardware for the specified driver. Every graphics driver must export an Enable function. Returns TRUE if successful, FALSE otherwise. lpDevInfo Address of a PDEVICE or GDIINFO structure depending on the value of the wAction parameter. wAction The initialization action. Can be one of these values: 0x0000 Initializes the driver and associated hardware and then copies device-specific information needed by the driver to the PDEVICE structure pointed to by lpDevInfo. 0x0001 Copies the device driver information to the GDIINFO structure pointed to by lpDevInfo. 0x8000 Initializes the PDEVICE structure pointed to by lpDevInfo, but does not initialize the driver and peripheral hardware. 0x8001 Same as 0x0001. GDI sets the high order bit of wAction only if an application has requested an information context. lpDestDevType Address of a string that specifies the device name. This string applies only to device drivers that support more than one model of the same device. This parameter can be NULL if only one model is supported. lpOutputFile Address of a string that specifies the name of the output port or file to receive output from the driver. The string must be a valid MS-DOS filename. This parameter must be NULL for the display. lpData Address of DEVMODE structure that contains information Enable uses to initialize the device. This parameter must be NULL for the display. The export ordinal for this function is 5. In some cases, GDI may request a raster device to write to a memory bitmap without enabling the device first. This occurs only with raster devices that can write to memory bitmaps. GDI calls this function when it creates a device or information context for an application, or when it restores the context after Windows returns from a full-screen application. For most devices, GDI calls Enable twice: first, to retrieve the driver's GDIINFO structure, and second, then to initialize the device and the PDEVICE structure. See Also Disable void Disable( LPPDEVICE lpDestDev ); Disables the specified device. Every graphics driver must export a Disable function. No return value. lpDestDev Address of a PDEVICE or PBITMAP structure that specifies the destination device or bitmap. The export ordinal for this function is 4. GDI calls this function when it deletes a device or information context for an application, or when it saves the context in preparation for Windows to switch to a full-screen application. |
|
|
板凳#
发布于:2005-01-14 15:51
谢谢你啦,不过能不能告诉我你的DDK在那下载的,我的DDK为什么没有函数的说明,找也找了,搜索也搜索了,就是没有!
再次谢谢你啦 |
|
|
地板#
发布于:2005-01-14 18:43
谢谢你啦,不过能不能告诉我你的DDK在那下载的,我的DDK为什么没有函数的说明,找也找了,搜索也搜索了,就是没有! 98DDK帮助里面的索引是不好用的, 使用搜索是有的 具体位置的目录树如下 related Driver Documentation-> windows 95 Document-> programmme's Guide-> Graphics device interface-> reference-> functions-> control |
|
|
地下室#
发布于:2005-01-17 08:38
谢谢啦,找到了,能不能告诉我你的msn或者qq,有好多问题想请教你呢,不知道方便不?
|
|
|