PC Review


Reply
Thread Tools Rate Thread

DLL Reference Problem

 
 
Don
Guest
Posts: n/a
 
      19th Jul 2004
I've got a problem with two DLLs that are referencing each other. Here is
the breakdown of the problem (the identifiers I use are not the real ones):

1. DLL-One declares a Class-X.

2. DLL-Two has a public method that has a parameter of Class-X (reference to
DLL-One required).

3. DLL-One calls the public method from DLL-Two, passing it an instance of
Class-X (reference to DLL-Two required).

4. VB Gives me an error in DLL-One stating "Reference required to assembly
'DLL-One' containing the type 'Class-X'. Add one to your project.

This makes no sense because Class-X is declared in DLL-One. Why is VB
telling DLL-One that it needs a reference to itself? Aside from creating a
new DLL to store Class-X or merging everything into one DLL, how can I fix
this? I don't even understand why I'm getting the error. Any help would be
greatly appreciated.

- Don


 
Reply With Quote
 
 
 
 
Jeremy
Guest
Posts: n/a
 
      19th Jul 2004
"Don" <(E-Mail Removed)> wrote in message
news:_aTKc.57031$Mr4.54266@pd7tw1no...
> I've got a problem with two DLLs that are referencing each other. Here is
> the breakdown of the problem (the identifiers I use are not the real

ones):
>
> 1. DLL-One declares a Class-X.
>
> 2. DLL-Two has a public method that has a parameter of Class-X (reference

to
> DLL-One required).
>
> 3. DLL-One calls the public method from DLL-Two, passing it an instance of
> Class-X (reference to DLL-Two required).
>
> 4. VB Gives me an error in DLL-One stating "Reference required to assembly
> 'DLL-One' containing the type 'Class-X'. Add one to your project.


This is a cyclic reference, and although .NET will take care of it for you,
it is a huge sign you should need to consider rethinking your design. The
fact that the two DLLs are inseperable, means that you should just combine
them into one DLL, or seperate out the cyclic dependancies, and put them
into a single DLL together.

If you do this, it will improve the overall quality or your design, and it's
almost certain to fix the error.

HTH,
Jeremy



 
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
access problem - reference problem ? Dennis hoyer Microsoft Access 10 27th Jun 2007 03:09 PM
problem with cell reference in =sum(offset(cell reference,x,y,z,a)). Want cell ref to be variable. twister212atop@yahoo.com Microsoft Excel Worksheet Functions 2 11th Dec 2004 12:05 AM
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable twister212atop@yahoo.com Microsoft Excel Worksheet Functions 2 11th Dec 2004 12:00 AM
Need help with this reference problem Microsoft Excel Programming 4 16th Aug 2004 07:57 PM
Word 2002 cross reference problem: Error! Reference source not found Sam Dutton Microsoft Word Document Management 0 31st Mar 2004 02:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:37 PM.