I hardcoded the string length to 1024 in my code because I know that's what it's supposed to be for bin names. The call that I've commented out in my code is returning 2, 4, or 5 depending on which printer I pass to it, and is generating error code 122, which translates to "The data area passed to a system call is too small."
>Sorry for jumping in. I think your class is great. The sample works fine too! Since you said you're not sure about the length of string, I've looked through your code for the buffer:
>
> * First call DeviceCapabilities in a way that returns the size of the buffer we need
>* lnBuffer = DeviceCapabilities(lcPrinterName, lcPort, tnValue, 0, 0)
>* The above call is only returning 2. Need to figure out why it's not correct.
>
>lnBuffer = 1024
>lcIDBuf = REPLICATE(CHR(0), lnBuffer)
>lnDCCnt = DeviceCapabilities(lcPrinterName, lcPort, tnValue, @lcIdBuf, 0)
>
>
>I think the return value from the first call is correct. Can you tell a bit more why do you think it is not? What printer you use to test it?
>Try to compare the return value from the first call with the second call. Both calls should return the same value
>
>Regards