CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2001
    Posts
    1

    Client\Server apps

    I have written a client server app which works fine. What I want is rather than to create a new instance of the server app each time a client connects, for all the clients to use the same instance. So effectively multiple clients connecting to one server. The reason for this is that I wish all the client's to share the same variable value which can be amended by each client.
    Any ideas of how I can achieve this, or sample code.

    Thanks.


  2. #2
    Join Date
    Apr 1999
    Location
    VA BEACH
    Posts
    467

    Re: Client\Server apps

    You can do it by creating a singleton object. One instance of the interface will be created and used by other processes. I don't know how you can do this in VB, in C++ you have a macro called
    DECLARE_CLASSFACTORY_SINGLETON().

    Use the MSDN and lookup singletons or book Professional ATL/COM programming by Richard Grimes might give you some ideas.

    Jim Hewitt
    Software Developer
    Liberty Tax Service
    www.LibertyTax.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured