We have learned what automation is and created a login management automation server. Now it's time to build a client application for that server to be more meaningful. You may be guessing why so much work has been done for just reading and writing a simple database, but now you will understand the benefits of this automation technique.
Once you build an automation server, to incorporate it in any client application, its just a simple task of few minutes. The automation server once built, can be used for different client applications built over different environments, without much changes. This would also isolate the client application from the dirty job of long database programming, creating a middle tier between the client application and your database. Further, if you make changes in the database structure, you will just have to change the automation server on the remote server, leaving the client application on all the machines unchanged. This also provides an easy technique for remote database management through DCOM (Distributed Component Object Model).
This tutorial assumes that you are familiar with Visual C++/MFC, COM, Automation and other technologies used in this tutorial like ADO, etc. Though there is no need to understand their underpinnings in great detail, you should at least have a working knowledge of what these underpinnings mean. Most important of all, you should take a glance over the login automation server example.
Now it's time to do some hands with DevStudio. We would create an automation client with the help of the type library created by the automation server example.
Here we have successfully built an automation client that can verify the user ID and password, allowing us to add new user, remove existing user and edit the user information. This client can be easily created in MFC, as you have seen how easy it was to connect to a remote automation server. We can use the remote objects created with the help of the type library, just as other objects created from some other classes. Your valuable suggestions are always welcome, to make this article better.
Learn how to extend your automation component over network via the use of DCOM, here.
This code is provided "as is" with no expressed or implied warranty. You can use and abuse this code without any restriction. If you use this source code in any commercial product, acknowledgment is not required but would be appreciated.
- VC++, COM and Beyond.
Author: Yashavant Kanetkar & Sudesh Saoji.
Publisher: BPB Publications.
User Level: Beginning-Intermediate.
This book provides an in-depth coverage of cutting edge technologies like Document/View Architecture, OLE, COM, DCOM, ActiveX, Open GL, Printing and Print Previewing, HTML Help System, Programming the disk and Screen Savers.