alanchinese Posted January 27, 2005 Posted January 27, 2005 i have two projects, ProjControls and ProjForms ProjControls includes CtrlAddress, which is a group of controls CtrlText (includes the TextBox control, for street, city, and zipcode) and CtrlOptions (includes ComboBox control, for state codes). ProjForms includes FormCustomer, that uses CtrlAddress inside the form. that's why i need to include ProjControls' dll for ProjForms ProjForms also includes FormZipcode, and FormCity, etc. which shares similar UI of the FormCustomer. what i want to do is, inside the CtrlAddress, i want to have a button so that by clicking it users can access information for certain zipcode or city. now i have the problem: I cannot include the reference of ProjForms into ProjControls.... i want to see how you handle this issue? should i combine ProjControls and ProjForms together (tha's not what i want to do, because there are reasons for me to group them seperately) thankx. Quote
IngisKahn Posted January 27, 2005 Posted January 27, 2005 Provided you're dealing with class libraries referencing other projects shouldn't be a problem. Quote "Who is John Galt?"
alanchinese Posted January 27, 2005 Author Posted January 27, 2005 Provided you're dealing with class libraries referencing other projects shouldn't be a problem. no, it complains i cannot link ProjControls to the forms because it will create a loop -- ProjForms already ref ProjControls. Quote
Wile Posted January 28, 2005 Posted January 28, 2005 Even if the devstudio wouldnt complain you still wouldnt want a circular reference: For instance you have dll A and dll B. Both try to refer to each other. Now the compiler needs B to compile A. But to compile A it would need to have a compiled version of B. It can't create either because each needs the other first. Why do you try to implement the lookup funcitonality in the control. Why not implement it in the forms. You can add an event to the Control that is triggered when the user clicks on the search button: ZipCodeInformationRequested (but give it a better name ;) ). This event can then be handled by the form and it can do the lookup it knows how to do. This trick will also keep your control lightweight and maybe even easier to re-use ;). Quote Nothing is as illusive as 'the last bug'.
Administrators PlausiblyDamp Posted January 28, 2005 Administrators Posted January 28, 2005 Could you not separate the shared functionality into a 3rd project and reference that from both the existing ones? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.