Solved

A Dll like application shared between multiple processes?

Posted on 1998-09-18
2
168 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
returning a dereferenced pts in C++ 10 167
Grammars for C C++ and java 1 138
sorting efficency of sorting algorithm 30 131
Embarcadero C++ builder XE10.1 Berlin TRegistry declaration 1 48
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

749 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