Denaes Posted May 10, 2004 Posted May 10, 2004 I'm doing this program thats way too many forms (well, only like 15) and I want to make it more modular. Most of the forms are pretty standalone. They all access the same database via the same dataclass I created, which uses datatables to transmit the majority of the information. Really, there are only a handful of variables that need to be accessed across the forms (loginID and securityRank, then mostly colours and custom settings), other than that, everything is pretty standalone. I wanted to make each form (or in one case pair of forms) into standalone .dlls that conform to an interface. Then to test them out I can just drop the .dll in the directly and select it off of the list. Mostly I'm using Divils Plug-In tutorial, but it deals with regular classes, not forms. What I need to know is probobly very easy, just how to get a form(s) into a .dll. Quote
sjn78 Posted May 10, 2004 Posted May 10, 2004 I think you can just create a class library project and then add your form to the project. I tried this once, many forms in a project so I did what you are doing, but had a few issues with passing data between form's (dll's). Maybe I wasn't thinking to straight back then, and you should actually be able to do it. Quote
AlexCode Posted May 12, 2004 Posted May 12, 2004 My current project is 100% plugin aware. Its base form is an MDI and the child forms come from diferent dll's depending on what modules the client payed for. For that, I made a solid n-tier environmentwhere the PL (presentation layer) have the MDI and few other things. The BL (Business Layer) actually is made out of many plug-in dll's. The DL (Data Layer) is referenced by all plug-ins and with a Session object, created by me, containing any relevant data about that user session (configs, DB Connection... anythig) I configure all the plug-ins when I initialize them. I even go a little further on this... My MDI have a Windows Explorer similar left menu (XtraNavBar from DevExpress) where the plug-ins add links when they initialize. So, you can do any kind of comunication between the 2 objects (Main Form & plug-in) since you have implemented the interfaces on both, you just have to ajust the interfaces to suite your needs. Alex :p Quote Software bugs are impossible to detect by anybody except the end user.
mooman_fl Posted May 12, 2004 Posted May 12, 2004 I have some code in the Code Library that deals with this exact topic. I made a project based off of divil's tutorial that loads a GUI onto your form from the plugin DLL. All the code to handle the forms events would also be contained in the plugin. Here is the link. http://www.xtremedotnettalk.com/showthread.php?t=70920 Quote "Programmers are tools for converting caffeine into code." Madcow Inventions -- Software for the Sanity Challenged.
AlexCode Posted May 12, 2004 Posted May 12, 2004 Just one alert... Never add a reference to a suposed plugin dll. This is kind of logic, but sometimes we tend to be irrational... If it's a plug-in and if it's not there, the app will fail to run cause can't make the reference! Alex :p Quote Software bugs are impossible to detect by anybody except the end user.
mooman_fl Posted May 12, 2004 Posted May 12, 2004 Just one alert... Never add a reference to a suposed plugin dll.... If it's a plug-in and if it's not there, the app will fail to run cause can't make the reference! Exactly... you make a reference to your interface and then DirectCast the plugins interface to your referenced interface. Quote "Programmers are tools for converting caffeine into code." Madcow Inventions -- Software for the Sanity Challenged.
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.