D
Dave Wee Pei Yang
Hi,
Can anyone help? Although PRNADMIN.DLL was meant to be used by scripting
however, due to certain requirements, I had to use it in my vb.net project
as a COM interop.
When enumerating the Printers using PrintMaster, everything's ok. Problem
appears for enumerating Drivers/Forms/Ports. The exception thrown was "The
data area passed to a system call is too small.". Has anyone got a clue?
Below's is a basic code snippet;
Private PrnAdm As New PRNADMINLib.PrintMaster
Private Driver As PRNADMINLib.Driver
Private Drivers As ArrayList
Friend Function EnumerateDrivers(ByVal txtServerName As String) As ArrayList
Try
For Each Driver In PrnAdm.Drivers("\\" & txtServerName)
Drivers.Add(Driver.ModelName)
Next
Return Drivers
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Function
Regards,
Dave.
Can anyone help? Although PRNADMIN.DLL was meant to be used by scripting
however, due to certain requirements, I had to use it in my vb.net project
as a COM interop.
When enumerating the Printers using PrintMaster, everything's ok. Problem
appears for enumerating Drivers/Forms/Ports. The exception thrown was "The
data area passed to a system call is too small.". Has anyone got a clue?
Below's is a basic code snippet;
Private PrnAdm As New PRNADMINLib.PrintMaster
Private Driver As PRNADMINLib.Driver
Private Drivers As ArrayList
Friend Function EnumerateDrivers(ByVal txtServerName As String) As ArrayList
Try
For Each Driver In PrnAdm.Drivers("\\" & txtServerName)
Drivers.Add(Driver.ModelName)
Next
Return Drivers
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Function
Regards,
Dave.