Memory resident Classes?

ian

Member
Joined
Jun 26, 2006
Messages
5
Programming Experience
10+
Hi, In the past I've written VB com programs, which had a 'central' class being held in memory. As other external programs have been run, they have all been able to access the 'data' held within the class, and access the data being passed into the class from other external programs. (ie a type of system wide global memory). Does any one know if this is possible in VB.Net, and give possible examples on how to create such objects/classes etc..

Thanks Ian
 
If you use shared variables or build a module rather than a class and point each program to the same library containing either the class with the shared variables or the same module then the same information will be shared accross them in system wide global memory. (In classes only the shared variables are the same.) At least I think this is what you are looking for. I will build a few harness programs and test this when I get home, I am at work right now.
 
In Memory Class

Thanks, I had suspicions it would be a 'shared/friend' type of variable/class. I just need to work out the logic to code it up. If you've got anything working as an example, that would save me no end of head-scratching...
 
IT appears 'Shared' variables etc.. are not visible in other external programs, but only within the currently active program. I think something like creating a 'Thread' which can act as an ASP Session might work??
 
What you ask for is called Inter-Process Communication (IPC). There are several solutions to achieve this:
- shared memory (SendMessage Win32 API with COPYDATASTRUCT will do that)
- shared filesystem (I would say so)
- sockets (System.Net namespace got it, typical TcpListener+TcpClient)
- Named Pipes (look it up)
- Remoting (.Net native support)

These are all each and one not small subjects of themselves, and the choosing depends on the environment where they have to operate. I recommend you do some research on the different solutions listed above.
 
Back
Top