Creating ActiveX Controls at runtime If you need to create an ActiveX Control at runtime without a resource template entry, follow the programming steps.

Slides:



Advertisements
Similar presentations
Using Macros and Visual Basic for Applications (VBA) with Excel
Advertisements

XP Tutorial 4 New Perspectives on Microsoft Windows XP 1 Microsoft Windows XP Personalizing Your Windows Environment Tutorial 4.
TPA Orientation Teacher Performance Assessments and Livetext.
Chapter 1 Creating a Flyer
Microsoft Office 2010 Access Chapter 1 Creating and Using a Database.
Chapter 3 Tables and Page Layout
Access Tutorial 1 Creating a Database
Copyright 2007, Paradigm Publishing Inc. POWERPOINT 2007 CHAPTER 1 BACKNEXTEND 1-1 LINKS TO OBJECTIVES Create Presentation Open, Save, Run, Print, Close,Delete.
CHAPTER © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 11 Scheduling.
Using the Visual Basic Editor Visual Basic for Applications 1.
Creating And Maintaining A Database. 2 Learn the guidelines for designing databases When designing a database, first try to think of all the fields of.
Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how to: Create macros Assign macros to events Associate macros with.
Chapter 5 Using Business Information Sets
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Word Project 8 Working with Macros and Visual Basic for Applications (VBA)
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Outlook Project 2 Scheduling Management and Instant Messaging Using Outlook.
Printing and Page Formatting ITSW 1401, Intro to Word Processing Instructor: Glenda H. Easter.
Document Basics Lesson 2. Skills Matrix SKILL #MATRIX SKILL 1.1.2Apply Quick Styles to documents 1.1.3Format documents using themes 1.1.4Customize a theme.
Chapter 9 Macros, Navigation Forms, PivotTables, and PivotCharts
Tutorial 1 Creating a Database. Objectives Learn basic database concepts and terms Learn basic database concepts and terms Explore the Microsoft Access.
Microsoft Office 2007 Word Integration Feature Linking an Excel Worksheet and Chart to a Word Document.
Microsoft Visual Basic 2005 CHAPTER 12 Cell Phone Applications and Web Services.
XP New Perspectives on Microsoft Access 2002 Tutorial 41 Microsoft Access 2002 Tutorial 4 – Creating Forms and Reports.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
CHAPTER © 2013 The McGraw-Hill Companies, Inc. All rights reserved. 3 Scheduling.
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 22 Macros.
IT 211 Project Integration and Deployment Lab #11.
Creating a Web Site to Gather Data and Conduct Research.
© Paradigm Publishing, Inc Access 2010 Level 2 Unit 2Advanced Reports, Access Tools, and Customizing Access Chapter 5Creating and Using Custom Reports.
Intro to MFC. Open VS and create new project 1)Open MS Visual Studio 2008 Professional (It must be the Professional Edition, the Express Edition will.
Chapter 6 Generating Form Letters, Mailing Labels, and a Directory
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
C++ MFCs CS 123/CS 231. MFC: Writing Applications for Windows zClasses in MFC make up an application framework zFramework defines the skeleton of an application.
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Creating a Form on a Web Page
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 2 1 Microsoft Office Access 2003 Tutorial 2 – Creating And Maintaining A.
FIRST COURSE Access Tutorial 4 Creating Forms and Reports.
OBJECTIVE  After completing this Lab, students will upgrade their knowledge in the field of VC++.  Students will also get the clear view about the concepts.
Active-HDL Interfaces Debugging C Code Course 10.
Chapter 1 Creating a Dreamweaver Web Page and Local Site
Microsoft Publisher 2010 Chapter 7 Advanced Formatting and Merging Publications with Data.
Using Microsoft Visual Studio 2005 Original by Suma Rao Revised by John G. McMahon ( 9/6/2008 )
Microsoft Outlook 2010 Chapter 3 Managing Contacts and Personal Contact Information with Outlook.
ActiveX Controls ActiveX Controls vs Ordinary Windows Controls Installing ActiveX Controls The Calendar Control ActiveX Control Container Programming Create.
Microsoft Access 2010 Chapter 8 Advanced Form Techniques.
Introduction to Web Services. Examples Using a Web Service Creating a new Web Service.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 7 – Creating and Using Templates in a Web.
Microsoft FrontPage 2003 Illustrated Complete Creating a Form.
Instructions.  Open up the letter that Adam has given to you  Format it so it look professional.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
Editing Basics Lesson 8. Skills Matrix SKILL #MATRIX SKILL 2.2.1Cut, copy, and paste text 2.2.2Find and replace text 4.1.1Insert building blocks in documents.
Chapter 3 Automating Your Work. It is frustrating when you have to type the same passage of text repeatedly. For example your name and address. Word includes.
INTRODUCTION TO ACCESS. OBJECTIVES  Define the terms field, record, table, relational database, primary key, and foreign key  Create a blank database.
1 After completing this lesson, you will be able to: Get around the Internet with your browser. Connect to the Internet. Print Web pages. Save Web pages.
1 Microsoft Project 2003 Starting a New Project. 2 Creating a new project plan To start Microsoft Project, click the Windows Start menu. Point to All.
Creating and Editing a Web Page
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 1 ® Database & Table.
1 /17 Installing and Configuring TaxWise © 2006, Universal Tax Systems, Inc. All Rights Reserved. Installing and Configuring TaxWise Objectives –In this.
Problem: Take Two Numbers, Add Them Together And Display The Results. Now To Build The Flowchart… We Probably Need One Like This… Let’s Add The Routines…
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
Tutorial 1 Creating a Database
Access Tutorial 1 Creating a Database
MFC Dialog Application
Chapter 7 Advanced Form Techniques
Access Tutorial 1 Creating a Database
Access Tutorial 1 Creating a Database
Access Tutorial 1 Creating a Database
Programming with Microsoft Visual Basic 2008 Fourth Edition
Presentation transcript:

Creating ActiveX Controls at runtime If you need to create an ActiveX Control at runtime without a resource template entry, follow the programming steps. 1.Insert the component into your project.Class wizard will create files for a wrapper class. 2.Add an embedded ActiveX Control data member to your dialog class or other C++ window class. 3.Choose resource symbols from Visual C++ View menu. 4.If the parent window is dialog, use class wizard to map dialog’s WM_INITDIALOG message.This call indirectly displays new control in the dialog. 5.The control will be destroyed when the parent window is destroyed. 6.If the parent window class, add the necessary event message handler And prototypes for the new control.

Calendar control

Step 1: –Verify that the Calendar control is registered. If the control does not appear in the Visual C++ Gallery's Registered ActiveX Controls page, copy the files MSCal.ocx, MSCal.hlp, and MSCal.cnt to your system directory and register the control by running the REGCOMP program. Step 2: –Run AppWizard (exe) and type project name. Accept all of the default settings but two: select Single Document and deselect Printing And Print Preview.

Step 2: In the AppWizard Step 3 dialog, make sure the ActiveX Controls option is selected, as shown below.In the AppWizard Step 3 dialog, make sure the ActiveX Controls option is selected, as shown below.

Step 3: Install the Calendar control in the EX08A project. Choose Add To Project from Visual C++'s Project menu, and then choose Components And Controls.Choose Add To Project from Visual C++'s Project menu, and then choose Components And Controls. Choose Registered ActiveX Controls, and then choose Calendar Control 8.0.Choose Registered ActiveX Controls, and then choose Calendar Control 8.0. ClassWizard generates two classes in the EX08A directoryClassWizard generates two classes in the EX08A directory

Step 4:Use the dialog editor to create a new dialog resource Make the Select Date button the default button. Drag the Calendar control from the control palette.Make the Select Date button the default button. Drag the Calendar control from the control palette. Then set an appropriate tab order. Assign control IDs as shown in the following table.Then set an appropriate tab order. Assign control IDs as shown in the following table. Control ID Calendar control IDC_CALENDAR1 Select Date button IDC_SELECTDATE Edit control IDC_DAY Edit control IDC_MONTH Edit control IDC_YEAR Next Week button IDC_NEXTWEEK

Step 5: Use ClassWizard to create the CActiveXDialog class Message Handler Function Object IDMessageMember Function CActiveXDialogWM_INITDIALOG OnInitDialog (virtual function) IDC_CALENDAR1NewMonth (event) OnNewMonthCalen dar1 IDC_SELECTDATEBN_CLICKEDOnSelectDate IDC_NEXTWEEKBN_CLICKEDOnNextWeek IDOKBN_CLICKED OnOK (virtual function)

Step 6:Use ClassWizard to add data members to the CActiveXDialog class. Click on the Member Variables tab, and then add the data members.

Step 8: Edit the CActiveXDialog class. Add the m_varValue and m_BackColor data members, and then edit the code for the five handler functions OnInitDialog, OnNewMonthCalendar1, OnSelectDate, OnNextWeek, and OnOK.Add the m_varValue and m_BackColor data members, and then edit the code for the five handler functions OnInitDialog, OnNewMonthCalendar1, OnSelectDate, OnNextWeek, and OnOK. Step 9 : Connect the dialog to the viewStep 9 : Connect the dialog to the view Use ClassWizard to map the WM_LBUTTONDOWN message, and then edit the handler functionUse ClassWizard to map the WM_LBUTTONDOWN message, and then edit the handler function

Step 11: Build and test the EX08A application. Open the dialog, enter a date in the three edit controls, and then click the Select Date button.Open the dialog, enter a date in the three edit controls, and then click the Select Date button. Click the Next Week button.Click the Next Week button. Try moving the selected date directly to a new month, and observe the message box that is triggered by the NewMonth event.Try moving the selected date directly to a new month, and observe the message box that is triggered by the NewMonth event. Watch for the final date in another message box when you click OK.Watch for the final date in another message box when you click OK. Press the F1 key for help on the Calendar control.Press the F1 key for help on the Calendar control.

Installing ActiveX Controls Copy the ActiveX control's DLL to \Winnt\System32Copy the ActiveX control's DLL to \Winnt\System32 Copy associated files such as help (HLP) or license (LIC) files to the same directory.Copy associated files such as help (HLP) or license (LIC) files to the same directory. Register the control in the Windows Registry. Actually, the ActiveX control registers itself when a client program calls a special exported function.Register the control in the Windows Registry. Actually, the ActiveX control registers itself when a client program calls a special exported function. The Windows utility Regsvr32 is a client that accepts the control name on the command line.The Windows utility Regsvr32 is a client that accepts the control name on the command line. Install the ActiveX control in each project that uses it.Install the ActiveX control in each project that uses it.

Choose Add To Project from the Project menu and then choose Components And Controls.Choose Add To Project from the Project menu and then choose Components And Controls. Select Registered ActiveX ControlsSelect Registered ActiveX Controls

This gets you the list of all the ActiveX controls currently registered on your system.This gets you the list of all the ActiveX controls currently registered on your system.

The Calendar Control