how to declare global Class library project?

R

Ron

Hello,

I need to create/instantiate a global class library
project so that 2 EXE's can write to the same class
library form in the same instance of the class libary. I
am thinking something along the lines of declaring the
class library project in a global assembly and then
referencing this global declaration from each of the 2
EXE's. Is the global assembly where I could declare my
global class libary project? How to do that?

Thanks
 
C

CJ Taylor

Easist way would be a web service. Otherwise a service itself using
remoting... (or services messages, but thats a whole other topic)

Now here is why.

In .NET libraries are loaded into their calling process. I haven't seen
anything that supports a shared memory segment like C++'s #pragma
declaration nor really see how. Each EXE is it's own process, has its own
memory reserved for it and cannot interact with other applications through a
shared library (at least one written in .NET).

Now, you could write a regular DLL (not activeX, because COM uses Single
Threaded Apartments *I think I'm right here.*) which would be right back
where you started. It would have to be written to support shared memory
addressing (a subject I'm not too familar with, just how its declared) and
it would obviously be unmanaged. So you have that to deal with as well.

Which leads me back to my original point of either a hosting application
supporting remoting (i.e a winforms app that has a singleton instance of the
class and simply acts as a server for the two other executable) or a web
service/service that runs in the background and also serves requests

Advantage of the web service. 95% of the work is done for you, easy as pie
to integrate into any .NET application. Disadvantage, you have to watch for
the aspnet_wp recycling and make sure you keep your data integrity up to
snuff. Service, you don't have to worry about the recycling, but you do
have a little more work ahead of you.

Let me know if you have any questions.

HTH,
CJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top