C++ Printer Mapping

Sorry for the basic question, but I don't usually program for Windows. I can't seem to find an answer to this myself. Is there any way to map printers in a C++ program? I know about Con2Prt and RunDLL32 PrintUI.dll. Is there a way to use PrintUI.dll as a library in a C++ program or is there another way to map printers? If all else fails, I guess I can just use system(), but I'd rather not.

I basically want to do the equivalent of con2prt /c \\server\printer
Last edited on
Geesh, that's a command I haven't seen in a LONG time. The modern way of doing this is "net share printername" without the quotes. Anyway the function you want is literally "AddPrinter()" found here: https://msdn.microsoft.com/en-us/library/windows/desktop/dd183343(v=vs.85).aspx
Topic archived. No new replies allowed.