Create a New Plug-in

Top  Previous  Next

In this portion of the tutorial, we will create a new plug-in, based on an existing example.  In the next section we will extend it with a couple of custom configuration options.

Create a New Project:

1.Launch CPPExamples.sln in Visual Studio Express.
2.Select View->Solution Explorer (if it is not visible)
3.Right-click on the first line (Solution 'CPPExamples....)
4.Select Add -> New Project
5.Select Win32 Console Application, enter 'tutorial' for the project name and press OK
6.Select NEXT and select Application Type: Console application
7.Select Empty Project then finish
8.Right-click on 'tutorial' project and select 'Add -> New Item'
9.Select 'C++ File(.cpp)' and change the name to 'tutorial'. Click 'Add'

Copy Existing Example into New Project

1.Expand 'echostate' and then 'Source files' in the Solution Explorer
2.Double-click on echostate.cpp to open it in an editor
3.Select 'Edit->Select All' then 'Edit->Copy' to copy entire file.
4.Click on the tutorial.cpp tab to activate it.
5.Select 'Edit->Paste' then 'File->Save tutorial.cpp'.

Change Project Settings to Auto-Install Plug-ins after each successful build:

This is optional but convenient.  Otherwise you will need to manually copy the plug-in from either <PDK Directory>\debug or <PDK Directory>\release to DigiView's plugin directory each time you rebuild. 

1.Right-click on the project 'tutorial' and select 'Properties'
2.Change 'Configuration' to 'All Configurations'
3.Paste the following line into the 'Post-Build Event command line' field and press 'OK':

       call ..\installplugin.bat $(OutDir) $(ProjectName)

autoinstall

Build, Install and Verify

1.Right-click on project 'tutorial' and select 'Rebuild'.  You should have a functional plug-in.
2.If you receive an error like: ' LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt', you have a known issue with .Net 4.5. One work-around is to right-click on 'tutorial' and select properties. Then select 'Linker->general->Enable Incremental Linking' and set it to NO.  Other work-arounds can be found with a web search.
3.Install and verify the new plug-in as in Install and Verify a Plug-in. Of course you will substitute 'tutorial.exe' for 'echostate.exe' in the instructions.
4.The tutorial.exe plug-in signal should look identical to the echostate.exe plug-in signal.