Click here to Skip to main content
12,950,618 members (65,197 online)
Click here to Skip to main content
Add your own
alternative version


33 bookmarked
Posted 30 Aug 2003

Login: Automation Client

, 4 Sep 2003 GPL3
Rate this:
Please Sign up or sign in to vote.
An automation client that connects to the automation server for verifying user ID and password.


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.

  • Create a dialog based MFC project unselecting everything in step 2 of 4 and accepting the default values for everything else.
  • Open the class wizard and create a new class from the type library, browse to the folder where the login.tlb file is located and select it.

    Confirm Classes

  • Include the remotelogin.h file to dialog class implementation.
  • Create the dialog as shown in the figure.

    Confirm Classes

  • Add a member variable m_login of type IRemoteLogin to the dialog class.
  • Add the following lines in the OnInitDialog() member function of the dialog class.
        AfxMessageBox("Login.CRemoteLogin Not found");
  • Link the buttons with dialog member functions and implement these functions as done in the sample project.
  • Compile the project now, it should compile without any errors and then run it.


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.

What Next

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.

    ISBN: 81-7635-206-8

    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.


This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


About the Author

Priyank Bolia
Software Developer (Senior)
India India
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionGood but What Purpose ??? Pin
kokosan16-Apr-07 6:13
memberkokosan16-Apr-07 6:13 
AnswerRe: Good but What Purpose ??? Pin
Priyank Bolia16-Apr-07 19:23
memberPriyank Bolia16-Apr-07 19:23 
Generalhelp Pin
vijin0512-Oct-06 2:22
membervijin0512-Oct-06 2:22 
Generalhelp Pin
badboy74127-Jul-05 9:53
memberbadboy74127-Jul-05 9:53 
GeneralRe: help Pin
Priyank Bolia27-Jul-05 18:45
memberPriyank Bolia27-Jul-05 18:45 
GeneralRe: help Pin
badboy74128-Jul-05 17:43
memberbadboy74128-Jul-05 17:43 
GeneralNot Updating the database Pin
Anand Kumar30-Sep-03 0:21
memberAnand Kumar30-Sep-03 0:21 
GeneralRe: Not Updating the database Pin
Priyank Bolia3-Oct-03 4:19
memberPriyank Bolia3-Oct-03 4:19 
Generalerror while running the client application Pin
Ananymous21-Sep-03 21:21
sussAnanymous21-Sep-03 21:21 
GeneralRe: error while running the client application Pin
Priyank Bolia23-Sep-03 20:01
memberPriyank Bolia23-Sep-03 20:01 
Questiondatabase location ? Pin
JOHN1131-Aug-03 0:12
memberJOHN1131-Aug-03 0:12 
AnswerRe: database location ? Pin
Priyank Bolia31-Aug-03 21:09
memberPriyank Bolia31-Aug-03 21:09 
AnswerRe: database location ? Pin
Anonymous8-Nov-03 18:17
sussAnonymous8-Nov-03 18:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170525.1 | Last Updated 5 Sep 2003
Article Copyright 2003 by Priyank Bolia
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid