Results 1 to 4 of 4

Thread: Printer Log problem

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2001
    Posts
    46

    Printer Log problem

    Hi all

    I have worked some thing out to get the printer related details which you can find in the code attached. but i am not able to get the machine name.

    i am using it on a nt server in which the priner is installed and the objective of this code is to maintain the log. i would like to get the machine name from which the print is issued.
    Kanaka Prasad

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    VB Code:
    1. Private Const MAX_COMPUTERNAME_LENGTH As Long = 31
    2. Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
    3. Private Sub Form_Load()
    4.     Dim dwLen As Long
    5.     Dim strString As String
    6.     'Create a buffer
    7.     dwLen = MAX_COMPUTERNAME_LENGTH + 1
    8.     strString = String(dwLen, "X")
    9.     'Get the computer name
    10.     GetComputerName strString, dwLen
    11.     'get only the actual data
    12.     strString = Left(strString, dwLen)
    13.     'Show the computer name
    14.     MsgBox strString
    15. End Sub

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2001
    Posts
    46
    Thanks for ur code but this doesn't solve my problem.

    I need to get the machine name who gives the print.

    please help
    Kanaka Prasad

  4. #4
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    Check out the code in the ApiPrintJob class - that has a Machinename member that is what you require.

    HTH,
    Duncan
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width