Solved

A Dll like application shared between multiple processes?

Posted on 1998-09-18
2
164 Views
Last Modified: 2010-04-01
I have a problem which you might be able to help me with.
I have an NT server that is attached to about 20 printers.
I am printing hundreds of jobs to these printers in a short
amount of time.(Bitmaps).  I am having problems when something goes wrong with the printers.  If something
happens to one of the printers, the queue gets backed up
with hundreds of jobs before the user notices that
something is wrong.  I know printer pools, thats kinda what
I want to do.  I can't use printer pools because I have to
know what job goes to which printer.  I am trying to
program my own printer pool.  Here is where you can help.
I have devised a .dll that my application uses that
has a "Black box" set of interface instructions.  Submit Job
Get printers average number of jobs etc.....
I want to have this dll running on the server and be able to
have applications call the submit job function with a handle
to a bitmap and have the print server print the job.
I need to be able to have multiple processes attached to the
same server because I have 3 different front ends for the
jobs that need to run simultaneously on the server and over
the nt network.  Can this be done?  I know that it cant
be a .dll, but maybe there is some other method of
programming a com? or something like that that has this functionality?..  Please help

Bryan
0
Comment
Question by:bwilkins081898
2 Comments
 
LVL 2

Accepted Solution

by:
milenvk earned 100 total points
ID: 1173102
Yes, you can do that, and yes, you can do it using COM. You need to create a single EXE out-of-process server in which you will develop your COM class and its class factory. Since the server is an out of process executable it will have its own process space and won't share the clients process space. When the server is invoked for the first time it has to register the class factory of your object using CoRegisterClassObject() API. Every time a client wants to create your object it will get the same class factory object and will ask it to create an object. Your class factory object should simply return a pointer to the interface of a single object that it has created. In this way all the client applications will share the same object. The cornerstone here is using EXE server instead of a DLL in-process server. Consider reading some COM books and examples, like "Essential COM" by Don Box, and "DCOM Professional Programming" by Richard Grimes. Good luck.
0
 

Author Comment

by:bwilkins081898
ID: 1173103
Thanks!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now