General information
Category:
Coding, syntax & commands
Nevermind...I seem to be good at answering my own questions only after I ask for assistance. Maybe it helps me think thru the problem better...
In any case, this is what I found out. Using NT 40 explorer w/ the QuickView option, WIN32SPL is importing, not exporting OpenPrinter. If I copy WINSPOOL.DRV to WINSPOOL.DLL and do the QuickView, I find that OpenPrinter is exported from there.
Then I realized that STRING @ is technically a pointer to a pointer because the string is already handled as a address
so the true declare shoul look like:
DECLARE INTEGER OpenPrinter IN winspool.drv STRING, INTEGER @, STRING
And then it would be called like:
m.nResult = OpenPrinter( "HP LaserJet 4", @nHandle, NULL )
>Has anyone had the need and been successful at making the OpenPrinter API call work?
>
>I have tried everything and am coming up short. I have a feeling that there may be something undocumented about Windows NT 4.0 and this call perhaps, since the DLL is no longer there.
>
>I have tried using both WINSPOOL.DRV and WIN32SPL.DLL
>
>VFox 5.0 says that it can't find the entry point win WIN32SPL.DLL and it says Data Type Mismatch when using WINSPOOL.DRV.
>
>Both however make it so far as to allow me to do the DECLARE DLL statement.
>
>This is what I believe should work:
>
>DECLARE INTEGER OpenPrinter IN winspool.drv STRING @,
> INTEGER @, STRING @
>OpenPrinter( "PrinterName", @nPHandle, NULL )
>
>I have tried defining a variable for printername, I have tried changing the second parameter to a 4 byte character, I have tried passing NULL to all 3. Each one says Data Type Mismatch.
>
>Has anyone done this successfully?
>
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only