4

I have some DLL exported functions that I'm trying to call from inside of VS2017 immediate window. The functions in the C++ header look like this:

namespace ma
{
    bool MODEL_DECLSPEC ClearParameter();
    bool MODEL_DECLSPEC GetResult();
          :
}

However, when I stop at a breakpoint in my code and type into the immediate window

ma::GetResult()

It returns

 identifier "ma" is undefined

I can call functions in the "std" namespace but not in my own namespace?

EDIT: I did some more tests and the immediate window interprets the "ma" namespace fine and calls my exported DLL function when my breakpoint is within the "ma" namespace scope inside the DLL. That's pretty limiting for debugging, so I'm sure I'm missing something?

mavis
  • 3,100
  • 3
  • 24
  • 32
buttonsrtoys
  • 2,359
  • 3
  • 32
  • 52
  • Wild guess - are these symbols exposed within the library? If not, maybe they got removed altogether. – hauron May 14 '18 at 18:21
  • 1
    @hauron, thanks for the thoughts. Yes, they're exported. (I did a "dumpbin /exports" on my DLL and can see the exported functions.) Is that what you mean? – buttonsrtoys May 14 '18 at 19:59
  • Not so sure this is a bug, they did not build a C++ compiler into the debugger. Make your case with the people that know, and can fix it, by using Help > Send Feedback > Report a Problem. – Hans Passant May 14 '18 at 23:39
  • Thanks Hans. When you say they did not build a C++ compiler into the debugger, you're saying the bugger and compiler are not as integrated as other languages, such as C#? That would explain why intellisense and the compiler often disagree. – buttonsrtoys May 15 '18 at 00:36

1 Answers1

4

Found out it had nothing to do with namespace. The native debugger won't look outside of its current module: "Immediate window can not execute a function exported by a dll"

There are some workarounds discussed here

buttonsrtoys
  • 2,359
  • 3
  • 32
  • 52