Debugging Plug-ins

Let's debug the plug-in [PgTest] which was created in 'Making plug-ins'.


  1. Start [Microsoft Visual C++ 2008 Express Edition].
    Click the menu [File] >[Open] >[Project/Solution] to open the dialog [Open Project]. Select "PgTest.sln" and click the button [OK].


  2. Set [Solution Configurations] in the toolbar to [Debug].


  3. Click the right mouse button on '[Solution 'PgTest'] in [Solution Explorer - PgTest] to show the shortcut menu.
    Click the menu item [Build Solution] to start the building.


  4. Confirm that the building process has been completed successfully.


  5. To let Dynamic Draw recognize the plug-in, some information has to add in the registory key.
    If your account does not have administrator authority, you have to login with administrator authority.
    Start [Command Prompt].
    If you are using Windows Vista or later version, you have to proceed the following.
    Click the right mouse button on '[Windows Start Button] >[All Programs] >[Accessories] >[Command Prompt]' to show the shortcut menu.
    Click the menu item [Run as administrator].


  6. Change the current directory to the directory '[PgTest]\Debug' in which 'PgTest.dll' exists.
    And enter the following.
    regsvr32 PgTest.dll


  7. By the proceedings above, the following dialog will be displayed.
    It has been succeeded to let Dynamic Draw recognize the plug-in [PgTest].


  8. Start Dynamic Draw by clicking the menu item in [Windows Start Button].
    Show the property page [Plug-in] of the dialog [Environment setup].
    Check [MyTest] and uncheck every checkbox else.
    Exit Dynamic Draw.


  9. Click the right mouse button on '[Solution 'PgTest'] >[PgTest] in [Solution Explorer - PgTest] to show the shortcut menu.
    Click the menu item [Properties].


  10. The dialog [PgTest Property Pages] will be displayed.
    Set the following settings.

    Click the button [OK].


  11. Open 'MpaCompo_0.cpp' and set a breakpoint at the beginning of the function "CA0::OnCommand".


  12. Click the menu item [Debug] > [Start Debugging] to start the debugging process.


  13. The debug symbolized Dynamic Draw will start.
    Click the menu item [Plug-in] > [Component-0] > [About Component-0].


  14. The function "CA0::OnCommand" will be called and it will break off the process at the breakpoint.


  15. Check the Call Stack and confirm that the function "CA0::OnCommand" has been called from the function "FCIMolipMain::OnCommand".
    Double-click the "FCIMolipMain::OnCommand" line in the Call Stack.


  16. The dialog [Find Source: molipexport.cpp] will be displayed because Visual C++ isn't set the directory where the source code exists.
    Set the directory "[TOP FOLDER]\DynamicDraw". It includes the source code file "molipexport.cpp" in which FCIMolipMain class is implemented.


  17. Consequently the source code file "molipexport.cpp" is displayed.