Re: Circular references ?
From: Dave S (dave_xxx70_at_hotmail.com)
Date: 04/07/04
- Next message: M. Angelo: "C to VB: meaning of ":" is structures"
- Previous message: Jamie Di Natale: "RE: Toolbar and mdi child forms"
- In reply to: Erik Frey: "Re: Circular references ?"
- Next in thread: Erik Frey: "Re: Circular references ?"
- Reply: Erik Frey: "Re: Circular references ?"
- Reply: Jason Sobell: "Re: Circular references ?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 07 Apr 2004 22:09:35 GMT
Erik,
Thanks for this, I just wanted to confirm that it's not possible to do it
with just 2 projects.
I tried moving my object into another project (so it's sort of an interface
project) and then each of the other projects can reference that project
without causing the circular reference problem.
I just thought it was a bit messy when in Java you could easily do this
without a middleman package containing the object you want to pass between
the classes.
At least I know that it wasn't something I'd missed out when declaring the 2
projects initially.
Will have to remember this one in future (I've been struggling with this all
afternoon)
Dave
"Erik Frey" <eriksjunk@hotmail.com> wrote in message
news:uCVltrOHEHA.3556@TK2MSFTNGP10.phx.gbl...
> "Dave S" <dave_xxx70@hotmail.com> wrote in message
> news:ac629e82aab3c366fe2c0c20e78b5eee@news.teranews.com...
> > Anyone know how to get round the problem of circular references in
VB.NET
> > (sorry I'm a .NET newbie).
> > I create one project which has 2 classes in it, MyHandler and MyObject.
> > MyHandler just needs to call another class in a different project and
pass
> a
> > parameter of type MyObject to it.
> > So the class in the different project needs to import the first project
> > namespace so it know what MyObject is.
> > The MyHandler class needs to import the second project namespace so it
can
> > call the class in the second project.
>
> Typically this is adressed by creating a third project that contains your
> business types in it.
>
> Then have your other two projects refer to this new project, to have
access
> to the common type (so in your case, put MyObject in the third project).
>
> Also, keep in mind that even if you have three projects in a solution, you
> still have to add the project references manually (right click on
> References - > Add References -> Projects tab)
>
> Erik
>
>
- Next message: M. Angelo: "C to VB: meaning of ":" is structures"
- Previous message: Jamie Di Natale: "RE: Toolbar and mdi child forms"
- In reply to: Erik Frey: "Re: Circular references ?"
- Next in thread: Erik Frey: "Re: Circular references ?"
- Reply: Erik Frey: "Re: Circular references ?"
- Reply: Jason Sobell: "Re: Circular references ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|