Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This topic applies to:
| Edition | Visual Basic | C# | C++ | Web Developer | 
|---|---|---|---|---|
| Express | .gif) | .gif) | Native only | .gif) | 
| Standard | .gif) | .gif) | Native only | .gif) | 
| Pro and Team | .gif) | .gif) | Native only | .gif) | 
Table legend:
| .gif) | Applies | 
| .gif) | Does not apply | 
| .gif) | Command or commands hidden by default. | 
Problem Description
The wrong parameter value is being passed to one of my functions. This function is called from all over the place. How can I find out what is passing it the wrong value?
Solution
To resolve this problem
- Set a location breakpoint at the beginning of the function. 
- Right-click the breakpoint and select Condition. 
- In the Breakpoint Condition dialog box, click on the Condition check box. For more information see How to: Specify a Breakpoint Condition. 
- Enter an expression, such as Var==3, into the text box, where Var is the name of the parameter that contains the bad value, and 3 is the bad value passed to it. 
- Select the is True radio button, and click the OK button. 
- Now run the program again. The breakpoint causes the program to halt at the beginning of the function when the Var parameter has the value 3. 
- Use the Call Stack window to find the calling function and navigate to its source code. For more information, see How to: Use the Call Stack Window.