【问题标题】:Error printing from 16-bit applications in Windows 2008 Server在 Windows 2008 Server 中从 16 位应用程序打印时出错
【发布时间】:2010-09-08 16:35:25
【问题描述】:

我在尝试在 Windows 2008 Server 中运行一堆旧的 16 位应用程序时遇到问题。 应用程序在 Windows 2003 Server 上运行良好,但是当我尝试从任何 他们,都显示打印错误(无法创建打印机驱动程序/ TERM错误/等)

  • LPT1 端口通过 NET USE LPT1 \ServerName\SharedPrinter 重定向到共享打印机
  • DIR > LPT1(或任何外壳重定向到打印机)工作正常。
  • 我使用的是管理员帐户,所以应该不是权限问题,对吧?

为了重现这种行为,我用 C 语言编写了一个小测试程序(TCC 1.01 for DOS)。它运行良好 在 XP / 2003 Server 中,但在 2008 Server 上,它显示句柄打开 (5) 但何时尝试 写入该句柄,发出错误(写入错误错误写入设备 LPT1,中止,重试, 忽略,失败)

#include <io.h>
#include <fcntl.h>
#include <sys\stat.h>

int main(void)
{
 int handle, status;
 char* sbuff;

 handle = open("LPT1", O_WRONLY, S_IFBLK);
 printf("%d\n", handle);

 if (!handle)
 {
    printf("open failed\n");
    exit(1);
 }

 sbuff = "[print test]\n";
 write(handle, sbuff, strlen(sbuff));

 close(handle);
 getch();

 return 0;
}

有什么线索吗?

TIA, 巴勃罗

【问题讨论】:

  • 您的测试程序在编译为 32 位时能正常工作吗?
  • @Cameron:我没有尝试过,但是这样做有什么意义呢?如果它有效,我将无法重新编译所有旧应用程序(在 XP / 2003 Server 上运行良好),因为其中许多来自第 3 方,而我没有来源。
  • 是的,但是您肯定会知道这是一些奇怪的 32 位/16 位不兼容问题还是与程序位数无关的其他问题。

标签: windows printing windows-server-2008


【解决方案1】:

Mike A - 我发现语法 'print /d:{lpt?} {filename}' 在 Win2008 上不起作用,不是来自 16 位应用程序或命令行。这种语法多年来一直受到支持,我们在 10 台 Win2003 服务器上运行它。 Win2008 中是否有一个配置设置可以使其语法与以前版本的 Windows 兼容?顺便说一句,这里是 2012 年 4 月更新的 Microsoft 技术公告,其中列出了与 Win2008 兼容的语法...http://technet.microsoft.com/en-us/library/cc731623

【讨论】:

    猜你喜欢
    • 2015-08-30
    • 2011-07-16
    • 1970-01-01
    • 1970-01-01
    • 2011-01-27
    • 1970-01-01
    • 1970-01-01
    • 2021-05-22
    • 2011-12-12
    相关资源
    最近更新 更多