|
-
Feb 16th, 2002, 06:41 AM
#1
Thread Starter
Member
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.
-
Feb 17th, 2002, 05:05 PM
#2
VB Code:
Private Const MAX_COMPUTERNAME_LENGTH As Long = 31
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Sub Form_Load()
Dim dwLen As Long
Dim strString As String
'Create a buffer
dwLen = MAX_COMPUTERNAME_LENGTH + 1
strString = String(dwLen, "X")
'Get the computer name
GetComputerName strString, dwLen
'get only the actual data
strString = Left(strString, dwLen)
'Show the computer name
MsgBox strString
End Sub
-
Feb 18th, 2002, 02:09 AM
#3
Thread Starter
Member
Thanks for ur code but this doesn't solve my problem.
I need to get the machine name who gives the print.
please help
-
Feb 19th, 2002, 11:50 AM
#4
Frenzied Member
Check out the code in the ApiPrintJob class - that has a Machinename member that is what you require.
HTH,
Duncan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|