views:

24

answers:

2

I have a method in C++:

HRESULT Foo(const ULONG bar, const ULONG baz, ODP& odp)

ODP is typedef'd to unsigned short.

When I call this method, I get a VS runtime check error when the calling method ends: "The stack around odp is corrupted."

When I look at the method being called, and hover my mouse, VS pops up this description:

Foo(const unsigned long, const const unsigned long, const unsigned short * const)

Why the inconsistency? Why the two consts for the middle param? Why isn't the last param ODP&?

A: 

Check to make sure you don't have two different definitions for Foo or ODP. If one definition is seen in one context and another somewhere else, you enter the land of undefined behavior.

Mark Ransom
A: 

Possible answer: the VS debugger is getting its info from the machine code, not from the source.

Rosarch