texmex
03-12-2006, 07:59 PM
Hi All,
I have been creating a VB6 app using a printer SDK DLL (the sample files are written in C++) and all has gone well so far, thanks to many people helping on this forum, but I am now stuck again. I am trying to expand my app to write to more than 1 printer at a time.
I have a line in the module that looks like this:
Public Declare Function chcusb_listupPrinter Lib "CHCUSB.DLL" (ByRefl IdArray As Byte) As Long
Now the IdArray should return all of the printer Id's (up to a max of 128, 0 to 127). But when I try the chcusb_listupPrinter I get an error "ByRef type mismatch", I have had a look at the help files and I am no closer to understanding the error. My code looks like this:
Private Sub cmdListUp_Click()
'list up printers
PrinterCount = chcusb_listupPrinter(IdArray)
lblText.Caption = PrinterCount
End Sub
The PrintCount is Dim'ed in the option explicit section as an integer. Could someone tell me what I am doing wrong please.
I have been creating a VB6 app using a printer SDK DLL (the sample files are written in C++) and all has gone well so far, thanks to many people helping on this forum, but I am now stuck again. I am trying to expand my app to write to more than 1 printer at a time.
I have a line in the module that looks like this:
Public Declare Function chcusb_listupPrinter Lib "CHCUSB.DLL" (ByRefl IdArray As Byte) As Long
Now the IdArray should return all of the printer Id's (up to a max of 128, 0 to 127). But when I try the chcusb_listupPrinter I get an error "ByRef type mismatch", I have had a look at the help files and I am no closer to understanding the error. My code looks like this:
Private Sub cmdListUp_Click()
'list up printers
PrinterCount = chcusb_listupPrinter(IdArray)
lblText.Caption = PrinterCount
End Sub
The PrintCount is Dim'ed in the option explicit section as an integer. Could someone tell me what I am doing wrong please.