In the midst of all this publicity writing ATL-based applications, you will
find little in the way of documentation on porting your legacy Win32 applications to
ATL. Hopefully, these steps will ease that migration path.
Include AtlBase.h file in StdAfx.h after AfxWin.h. This is to take advantage to
declare a variable for CComModule. Because AtlWin.h file needs, _Module as variable
We have to keep extern because we are originally declaring variable in
Application main file.
extern CComModule _Module;
Then include the remaining files which helps for an ATL Application. In the insert Object of ATL uses ATLHost.h which needs to compile atlcom.h as before.
In the StdAfx.cpp, Include AtlImpl.cpp file.
In the main Application file, add the following
//originally declaring the CComModule variable
Then, Add the following two lines, which are required to activate ATL
Object Wizard, when you choose Insert ATLObject from Insert Menu.
Initialize the CComModule variable with ObjectMap and with the current
instance in the WinMain function
Add the <ProjectName>.idl file into the project and add the library related code:
If you want to insert a dialog and want to show. Follow the above steps and
declare the variable of ur dialog class and call DoModal with that variable
(don't forget to include dlg header file).
This code has been tested with and works fine with the Windows CE environment.
References and Acknowledgments
ATL Internals - Rector, Sells (My thanks to the Authors!)
Event Date: September 10, 2014
Modern mobile applications connect systems-of-engagement (mobile apps) with systems-of-record (traditional IT) to deliver new and innovative business value. But the lifecycle for development of mobile apps is also new and different. Emerging trends in mobile development call for faster delivery of incremental features, coupled with feedback from the users of the app "in the wild." This loop of continuous delivery and continuous feedback is how the best mobile …
Webinar on September 23, 2014, 2 p.m. ET / 11 a.m. PT
Mobile commerce presents an array of opportunities for any business -- from connecting with your customers through mobile apps to enriching operations with mobile enterprise solutions. Join guest speaker, Michael Facemire, Forrester Research, Inc. Principal Analyst, as he discusses the new demands of mobile engagement and how application program interfaces (APIs) play a crucial role. Check out this upcoming webinar to learn about the new set of …