Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Printers.Count - Help needed!!

Status
Not open for further replies.

cturland

Programmer
Sep 25, 2000
66
GB
Hi all,

I've created an ActiveX dll that counts the amount of printers on a machine using a simple "msgbox(printers.count)". When I call the function in a VB application it returns 7 - which is correct. I'm now trying to use the dll within a Cold Fusion page(web enviroment). Whenever I call the function it always returns 0!!

I have tried everything I can think of, does anyone else have any idea why this is happening?
 
Ceep in mind that you execute the DLL on the server, NOT the client. So you will return the number of printers the server is connected to.

If this is 0, problem solved. (If you still need the number of printers client side, you will have to do it the Javascript way.)
If not, there is obviously a problem with your code. If you are more specific, and provide us with some code, we may be able to help you.

Good Luck
-Mats Hulten
 
I figured the problem out in the end. It was to do with the system registry. When you are logged onto the internet and run a dll the default user settings in the registry are looked at and not the user you are logged in as.

I ended up writing an exe that reads all the printer settings from the user logged on and writes them to the default user in the registry. This solved the problem and now external clients can print to the server printers - which was the main aim.

Rgds,
Carl
 
CTURLAND,

can you please let me know how you have done that ? i am facing a similar problem and struggling to find a solution. and it is urgent.

thank you kindly,
-hari
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top