-
Feb 22nd, 2012, 05:02 PM
#1
[RESOLVED] Dll related question
I am currently rewriting a server application that was originally done in VB6. Over the years it has grown and services several different clients with several different needs. In re-writing this server I would like to modularize it a bit.
Is it possible to build the exe where it will reference a dll that may be different for every client so long as the dll name is the same and the procedures called are of the same name, type and parameters?
I have not tried this at all yet and am hoping someone out there knows if it is possible or not before I invest the time to try and code it.
Any tips would be helpful.
The general idea is that my core program will handle all communications. When a transaction arrives it will call a method in this dll which will be responsible for processing the transaction and returning some result in the form of a string. The dll itself may have only one or 2 methods or may have lots of them depending on the needs of the client. When shipped to the client they would get the core exe and a dll that is customized to thier needs assuming it can be done without the need to rebuild the exe for every new client which is currently the case.
Or perhaps there is a better way to address this that I have not thought of yet?
-
Feb 22nd, 2012, 05:14 PM
#2
Re: Dll related question
In your main project create a class library that contains an interface with the common properties and methods in it. Reference this interface in your executable. In seperate projects create class libraries that implement your interface. As you mentioned, you may have to update the project settings so the dll name will be consistant. Deploy your executable, interface dll, and the partner specific dll.
That is the very essence of human beings and our very unique capability to perform complex reasoning and actually use our perception to further our understanding of things. We like to solve problems. -Kleinma
Does your code in post #46 look like my code in #45? No, it doesn't. Therefore, wrong is how it looks. - jmcilhinney
-
Feb 22nd, 2012, 05:28 PM
#3
Re: Dll related question
No, you won't need to update anything for that to work, as long as the dll will be in a known location. You can examine all *.dll in that location to see whether they have objects that implement the interfaces defined in the common dll, or if they are types defined in the common dll. That would be a plug-in system. I have code that I have posted before showing how to peruse the dlls in a folder to find objects that implement a certain interface.
My usual boring signature: Nothing
-
Feb 22nd, 2012, 08:26 PM
#4
Re: Dll related question
Thanks guys, that points me in the right direction. I managed to find a couple samples of implementing a simple interface and will see what I can come up with.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|