I must express my appreciation at everyone's politeness.
Nothing is wrong with William R.'s suggestion. It's only that I've been
using VS for about 3 months, and while I'd love to define a class in in one
file and instantiate it in the same as well as in another project's file, I
don't know how to yet (step-by-step). I am familiar with a host of other
languages, so I think it will only be a matter of getting my explanation up
to speed, and understanding how VB's scoping rules work.
What I'd like to do is let two projects instatiate from the same class.
I'm writing two projects. One will allow one machine, the Client, to
initiate a connection with another machine, the Server. The Client will ask
the Server for some updates (similar to FTP), then close the connection. In
writing these projects, I am writing a class called clsCommunication, which
houses some commands for establishing, maintaining, and closing down a
connection via TCP. It is currently about 200 lines long, and identical in
Client.vb and Server.vb. I'm learning all about TCPClient, TCPListener,
threads, and events, and while it's taxing my brain, I'm having great fun
doing so. (Plug: I got a lot of help from Sybex's _Visual Basic .NET
Developer's Handbook_.) My Server application listens for and accepts
connections, and my Client application initiates connections. (Side note:
If you've written code using TCPClient and TCPListener, then you'll know
that they must interact together. If not, please take it on faith that I
made the transition from having a lot of very awkward code for both Server
and Client, to seeing the advantages of having Server and Client create
instantiations of clsCommunication.) Every time I improved (pronounced,
"found bugs in") clsCommunication, I had to copy and paste 200 lines of
nearly identical code. Soooooo, now I want my Server project and Client
project to see the same file which houses clsCommunication, or to get
clsCommunication's scope within Server and Project's view.
I did not explain where clsUserInfo before. clsUserInfo is a class with
only 2 lines of code, and I was using it to test the suggestions Ryan and
Wagner offered. I wanted to first get my problem resolved with clsUserInfo,
and then I will get it working with clsCommunication.
I am operating under the impression that I Client must depend on the file
which contains clsCommunication, and Server must also depend on the file
which contains clsCommunication. If I need to achieve a dependency graph
that flows however in one direction only, then my impression must be wrong.
Here is my entire Solution as it stands right now:
Solution Mercury
--project Client
----References
----AssemblyInfo.vb
----Client.vb
----net12.ico
--project Common
----References
----AssemblyInfo.vb
----Class1.vb
--project Server
----References
----AssemblyInfo.vb
----Server.vb
--project Setup
----Detected Dependencies
----Primary Output from Client (Active)
As of right now, I have no object dependencies.
Sincerely,
William Meitzen. <><