Robotizing Visual C++ IDE utilizing Include ins and Macros Ranga Narasimhan Microsoft Engineer Support Microsoft Enterpr.

Uploaded on:
Mechanizing Visual C++ IDE utilizing Include ins and Macros Ranga Narasimhan Microsoft Designer Backing Microsoft Enterprise Extent of the Presentation Brief prologue to computerization Outline of Microsoft ® VC++ ® IDE robotization Different techniques for robotizing VC++ IDE
Slide 1

Robotizing Visual C++ IDE utilizing Add-ins and Macros Ranga Narasimhan Microsoft Developer Support Microsoft Corporation

Slide 2

Scope of the Presentation Brief prologue to computerization Overview of Microsoft ® VC++ ® IDE robotization Various systems for mechanizing VC++ IDE Overview of include ins and macros Debugging include ins and macros Customizing the VC++ IDE

Slide 3

Overview: Automation depends on COM Automation makes it workable for one application to control items actualized in another application, or to "expose" questions so they can be controlled Automation can be performed by a project composed utilizing COM-mindful dialect, for instance, VC++, Microsoft ® Visual Basic ® (VB), etc

Slide 4

Overview: VC++ Automation VC++ is a mechanization server VC++ computerization can be utilized to augment the capacities of VC++ You can mechanize VC++ utilizing any dialect that backings COM. Engineers ordinarily utilize VBScript, VC++, and VB

Slide 5

VC++ Automation History Automation was initially presented with VC++ 5.0 IDE VC++ 6.0 altered some significant bugs and presented some new strategies (BuildProject.AddFile) VC++ 6.0 additionally presented the “Quick Macro” highlight See “Microsoft Visual C++ 6.0 Migration Guide” subject on MSDN for more data on the new VC++ 6.0 elements

Slide 6

VC++ Object Model

Slide 7

Object Model Overview Provides 17 items Objects give routines and properties The Application and Debugger articles give occasions

Slide 8

VC++ Automation Support VBScript full scale Add-ins (DLL) composed utilizing VC++, VB, or some other dialect that backings COM Automation customers (EXE or DLL) composed utilizing VC++, VB, or some other dialect that backings COM Remote mechanization through DCOM

Slide 9

Add-ins Macros Written in VC++, VB, thus on Can get to neighborhood PC assets other than article model Access Win32 ® API Early bound Can control another EXE Written in VBScript Can get to the item model and some other COM objects Cannot get to Win32 API Late bound Cannot control another EXE

Slide 10

Creating a Macro File In VC++ IDE, on the File menu, click New. Click the Files tab. Select “Macro File” and give it a name. This will make a void full scale (DSM) document where you can begin writing code: Sub Test() MsgBox “Hello World” End Sub

Slide 11

Recording a Macro Another technique for recording so as to make a large scale is. On the Tools menu, click Macro, and afterward snap Record. You will need to give it a full scale name (depiction is discretionary). The recording begins promptly and the activities that you perform are recorded. On the Tools menu, click “Stop Recording” to quit recording the full scale.

Slide 12

Creating Add-ins To make a VC++ include utilize the “DevStudio Add-in Wizard.” You have a choice to incorporate toolbars and occasion taking care of in Step 1 of 1. To make a VB include, utilize the VB 5.0 include test dispatched with the MSDN Library. You can most likely compose an include utilizing a dialect that backings COM.

Slide 13

How Are Add-ins Implemented ? Actualize the IDSAddin interface. This will unite and separate the include with VC++ Implement an ICommand interface that DevStudio will use to call your include routines Provide usage for IApplicationEvents and IDebuggerEvents for occasion taking care of (discretionary) You are not constrained to VC++ and VB for include execution

Slide 14

Installing Add-ins and Macros On the Tools menu, snap Customize. Click the “Add-ins and Macro files” tab. Click the Browse catch and find the DSM (Macro) or DLL (Add-in) record. In the event that it is introduced appropriately, you’ll see a check detriment for the full scale/include. Click the Close catch.

Slide 15

Calling Add-in and Macro Commands If you have one or more order catches connected with your large scale and/or include summons, click those catches. You can likewise begin them from the summon line: Msdev.exe - ex charge name Call them from another include and/or full scale utilizing the Application.ExecuteCommand technique

Slide 16

Debugging To troubleshoot macros, you ought to utilize the PrintToOutputWindow or MsgBox system To investigate include ins, you will need to indicate Msdev.exe as the executable for the troubleshoot session in light of the fact that it’s a DLL

Slide 17

Customizing the VC++ IDE On the Tools menu, snap Customize. Click the Commands tab. Under Category, snap Add-ins or Macros. Drag the symbol recorded in the Buttons gathering to the area you need.

Slide 18

Some Limitations and Known Problems Macro names can\'t have an underscore. It is saved for occasion systems. You can\'t pass contentions to include and full scale orders. You can\'t begin various include and full scale summons. You can include an undertaking, yet can\'t uproot a venture. You can\'t change the yield filename for static library venture.

Slide 19

Useful Articles Q247035 “HOWTO: Automate Visual C++” Q231636 “HOWTO: Controlling the Visual C++ IDE Source Code Editor Window” Q237870 “HOWTO: Increment Version Information After Each Build in VC++” Q248130 “FILE: AutoSave.exe Provides AutoSave for Visual C++”

Slide 20

References “Extend Developer Studio 97 with Your Own Add-ins, Macros, and Wizards,” Steve Zimmerman (MSJ, 9/97) “Extending Developer Studio with Add-ins,” Richard Grimes (MSDN Library) Automated Builds in DevStudio, or the Night Build Scenario “Enhancing the Visual C++ 5.0 Workplace with VBScript Macros” by Mark Davis â

View more...