Solved

A Dll like application shared between multiple processes?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Which IDE to use to begin C++ training? 5 59
Template syntax for variable length arrays 9 71
thread-safe code in c++ 2 84
best sources to up-to-date in C++? 8 70
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

910 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

20 Experts available now in Live!

Get 1:1 Help Now