Error in Visual Studio:

Follow these steps when you are running your VS program in debug mode,
a. Right click your project name -> go to properties.
b. On the left page, click on Debug Tab.
c. Check the Enable unmanaged code debugging checkbox.
d. Your code should run in debugging mode.