ATL ActiveX Controls
In this section, we will use ATL to build an in-process server that supports a simple ActiveX control. We will call the in-process server ATLCyberServer and our ActiveX control ATLCyberOcr. ATLCyberOcr allows people across the globe to perform OCR processing. It allows a user to select an image from disk storage and requests OCR processing on the selected image. When asked to perform OCR processing, the ATLCyberOcr ActiveX control will delegate the task to the back-end OCRServer component that was built in Chapter 6.
In addition to this functionality, we will also learn how to attach proxy/stub code into the ATLCyberServer component that we’re building to mitigate the setup and registration pain during component download.
Creating the Project
Let’s start off by creating the project as directed in the following steps:
Use the
ATL COM AppWizardto create a new project. Name this projectATLCyberServerand clickOKto proceed.In Step 1 of the
ATL COM AppWizard, select DLL as theServer Type.Check the
Allow merging of proxy/stub codecheck-box, so that the proxy/stub code will be merged into the resulting DLL. This is important for an ActiveX control that is downloaded across cyberspace. Recall that if the threading models of the in-process server and the hosting out-of-process server differ, marshaling will result. In order to successfully standard marshal a custom interface, you must provide and register its proxy/stub code. Selecting this option will automatically ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access