Well I must say, after reading your suggestion I checked and found printer
sharing NOT to be enabled. So I was hopeful that was the trick. Alas, after
enabling it, rebooting and then trying again it still fails with the same
error <sigh>.
I wish the MSDN was more specific about whether it works on 9x/ME when these
platforms are called remotely. It does indicate that the API is supported on
Windows 95 and higher --it just doesn't specifically state that it is not
supported when calling them remotely. Though, it does leave one the
impression that those platforms are supported when reading the text for the
pEnvironment value.
Thanks for your post. If anyone has anything further to suggest or comment
please do!
JW
> Any chance that "File and Printer Sharing for Microsoft Networks" is not
> active on the ME computer? I saw something about it being needed for
[quoted text clipped - 69 lines]
> | > :
> | > : JB
Steve Gerrard - 29 Nov 2004 00:14 GMT
pEnvironment
"Pointer to a null-terminated string that specifies the environment (for
example, Windows NT x86, Windows IA64, Windows x64, Windows NT R4000,
Windows NT Alpha_AXP, Windows 4.0, or Windows NT PowerPC). If this
parameter is NULL, the function uses the current environment of the
caller/client (not of the destination/server)."
You are calling with NULL (vbNullString). That would mean you are using
the "current environment of the caller", which is Windows NT (WinXP),
wouldn't it? Maybe you should try the call with "Windows 4.0", which I
think means pre-NT. Maybe?
| Well I must say, after reading your suggestion I checked and found printer
| sharing NOT to be enabled. So I was hopeful that was the trick. Alas, after
[quoted text clipped - 86 lines]
| > | > :
| > | > : JB
Jerry West - 29 Nov 2004 00:27 GMT
I did note that information in the MSDN originally and so I am passing the
proper value for the remote system in question (in the case of ME it is
"Windows 4.0"). This does not correct the issue.
JW
> pEnvironment
> "Pointer to a null-terminated string that specifies the environment (for
[quoted text clipped - 115 lines]
> | > | > :
> | > | > : JB
Randy Birch - 29 Nov 2004 04:50 GMT
Hi Jerry ...
Are you sure you don't want the simpler EnumPrinters function rather than
EnumPrinterDrivers? EnumPrinters is a mandatory function that all providers
must respond to; EnumPrinterDrivers is used to "return a list of printer
drivers that have been added to a specified server by calling
AddPrinterDriver or AddPrinterDriverEx".
It is my understanding that EnumPrinterDrivers is used to enumerate the
available printers drivers that can be installed from a network server onto
a machine running the environment specified under the pEnvironment variable.
IOW, you're on a XP box, you query the server for "Windows NT x86" (or
"All") to get the list of printers the server can install onto that XP box.
You're on a 9x box you ask for "Windows 4.0".
As for the RPC error, it could be the required ports on the machine are
blocked or the machine has an incompatible network adapter error. Also, is
there a print$ admin share on the ME machine? Finally, the XP machine must
have rights to access the remote machine -- for example, on an XP -to- XP
network, if the calling XP machine does not have permission to access the
shares because the calling machine has not yet successfully completed a
required authentication challenge, the error returned through
Err.LastDllError is 1722. So in this case it's not so much an "RPC error";
it's an "error accessing the remote machine via RPC due to insufficient
credentials". Methinks 1722 might be a catch-all error code.
Also, have you determined that running the same code provides the expected
info when the app is run locally on the ME machine with vbNullString
specified as the server?
There's also some EnumPrinterDrivers code at
http://vbnet.mvps.org/code/enums/enumprinterdrivers.htm) which may provide
some other insight.

Signature
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
Jerry West - 29 Nov 2004 16:55 GMT
Randy,
Thanks for your comments. It does appear that EnumPrinters would indeed do
what I need. A little more work is involved and it looks like I'd need to
use a PRINTER_INFO_2 structure versus what I originally wanted;
PRINTER_INFO_3. At any rate, thanks for pointing me toward another possible
solution!
JW
> Hi Jerry ...
>
[quoted text clipped - 34 lines]
> http://vbnet.mvps.org/code/enums/enumprinterdrivers.htm) which may provide
> some other insight.