CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 23

Threaded View

  1. #1
    Join Date
    Oct 2006
    Posts
    82

    How to instantiate DLLs to avoid indirect calls?

    I have a problem with building and using DLLs. I have built several to be used in a Windows Application, but basic enough to be re-usable. The problem is that they have to be instantiated and that means indirect calls to nested DLLs. Isn't there a better way?

    I have attached a diagram. In Figure 1 boxes represent classes: A Windows main form, a subform inside the main form, DLL1 and DLL3 instantiated inside the main form, adn DLL2 instantiated inside DLL2. Now...for the subform to call something in DLL2 is pretty messy, and getting from DLL2 to DLL3 is tougher still, because if I have to code indirection, then the DLLs are pretty well cutomized to the architecture, and that doesn't let them be re-usable.

    What I want is an architecture more like Figure 2: the subform is still inside the main form, but the DLLS are "outside" and can be called directly from the forms application and from one DLL to another (via interfaces). But where does one instantiate these DLLs? and their interfaces? (Static classes can't inherit interfaces, so that idea is out.)
    Attached Images Attached Images

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