0

I encountered this code:

NAMESPACE_NCO_BEGIN

class NCO_VIEWS_DECLSPEC MyView:
    public CWnd
    { 
    };

NAMESPACE_NCO_END

What does the NCO_VIEWS_DECLSPEC mean?

MyView is class name.

If possible try to explain NAMESPACE_NCO_BEGIN and NAMESPACE_NCO_END.

Keith Thompson
  • 254,901
  • 44
  • 429
  • 631
  • 5
    They are probably preprocessor macros. See if you can find their `#define` lines. – aschepler Jul 25 '14 at 15:30
  • They are most probably `declspec` for `import`/`export` this class in that dll. – Stephane Rolland Jul 25 '14 at 15:32
  • 4
    Probably `__declspec(dllimport)` or `__declspec(dllexport)`. – chris Jul 25 '14 at 15:33
  • I've edited your question to improve the formatting. Please check that it still matches the code you're asking about. – Keith Thompson Jul 25 '14 at 15:33
  • 1
    The `NCO_VIEWS_DECLSPEC` can't be found on Google, which means it is probably a macro from a proprietary library. It is therefore very difficult to give a 100% accurate answer. A few clever guesses have been made already, though. – SirDarius Jul 25 '14 at 15:34
  • If you cannot easily find definition of NCO_VIEWS_DECLSPEC in the source code, then enable preprocessor output and have a look how the symbol was expanded. (See e.g. http://stackoverflow.com/questions/277258/c-c-source-file-after-preprocessing) – Petr Vepřek Jul 25 '14 at 15:39
  • In Visual Studio, you can generally right click and select "Go To Definition". Makes it easy to find out what that stuff means. – crashmstr Jul 25 '14 at 15:43

1 Answers1

3

All three are macros. Somewhere in the code, possibly in some included header file, there must be #defines for them. NCO_VIEWS_DECLSPEC most certainly translates to some compiler-specific class attribute, e.g. __declspec( dllexport) for Microsoft Visual C++. Look here for a detailed example: Using dllimport and dllexport in C++ Classes

Christian Hackl
  • 27,051
  • 3
  • 32
  • 62