PC Review


Reply
Thread Tools Rate Thread

how to declare global Class library project?

 
 
Ron
Guest
Posts: n/a
 
      21st Oct 2004
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
 
Reply With Quote
 
 
 
 
CJ Taylor
Guest
Posts: n/a
 
      23rd Oct 2004
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


"Ron" <(E-Mail Removed)> wrote in message
news:009301c4b79a$4b9c5640$(E-Mail Removed)...
> 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



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem using regular class library project in device project enantiomer Microsoft Dot NET Compact Framework 7 18th Feb 2006 05:32 PM
Code behind project and I need to declare a global veriable where do I do this since there is no .h file Bryan G Microsoft C# .NET 4 26th Mar 2004 11:53 PM
Code behind project and I need to declare a global veriable where do I do it at Bryan G Microsoft ASP .NET 2 26th Mar 2004 10:51 PM
Code behind project and I need to declare a global veriable where do I do this since there is no .h file Bryan G Microsoft Dot NET 1 26th Mar 2004 08:31 PM
Re: How to declare a 'global' class J.Marsch Microsoft C# .NET 0 17th Mar 2004 06:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:33 PM.