只发过一个帖子,还没结,结帖率是0。
    Dim pd As PRINTER_DEFAULTS
    Dim hPrinter As Long
    pd.DesiredAccess = PRINTER_ALL_ACCESS
    OpenPrinter "POS58", hPrinter, pd
    Dim err_prn, err1_prn       As Long
      err1_prn = PrinterMessageBox(hPrinter, err_prn, Text1.hwnd, "hello ", "POS58", MB_ICONSTOP)
    Me.Caption = err_prnMe.Caption没显示任何内容

解决方案 »

  1.   

    这说明你调用该函数失败PrinterMessageBox 
    VB声明 
    Declare Function PrinterMessageBox Lib "winspool.drv" Alias "PrinterMessageBoxA" (ByVal hPrinter As Long, ByVal error As Long, ByVal hwnd As Long, ByVal pText As String, ByVal pCaption As String, ByVal dwType As Long) As Long 
    说明 
    在拥有指定打印作业的系统上显示一个打印机出错消息框。如一名用户在远程登录,这种做法便相当有用 
    返回值 
    Long,IDOK, IDRETRY 或 IDCANCEL;由用户的输入决定(如消息框在远程系统显示,则肯定是IDOK) 
    参数表 
    参数 类型及说明 
    hPrinter Long,出现错误的打印机的句柄 
    error Long,ERROR_OUT_OF_PAPER(缺纸)或ERROR_NOT_READY(未就绪) 
    hwnd Long,指定消息框的父窗口。可以为NULL 
    pText Long,欲显示的消息正文 
    pCaption Long,消息框的标题 
    dwType Long,指定任何一个标准的MessageBox标志。建议使用MB_ICONSTOP 或 MB_RETRYCANCEL 或 MB_SETFOREGROUND 
    适用平台 
    Windows NT