CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 4 of 4

Thread: Simple class declaration question

  1. #1
    Join Date
    Aug 2009

    Question Simple class declaration question


    I have seen a class declaration like this:

    class ClassA NewClass public: ClassB

    I can see that ClassB is the base class of NewClass, but I cannot understand why ClassA was put before NewClass... If that program didn't work, I would think it is a bug and simply type:

    class NewClass public: ClassB

    Thanks in advance.

  2. #2
    Join Date
    Jan 2006

    Re: Simple class declaration question

    That looks like a syntax error. I suggest that you post the smallest and simplest compilable program that demonstrates it.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  3. #3
    Join Date
    Aug 2009

    Re: Simple class declaration question

    Thank you for your reply. Actually this is part of a very large program. Instead, I am providing the comments of the coder right before this line:

    // class NewClass inherits from ClassB,
    // ClassA handles export/import of DLL
    // Enables export and import of functions, data, and objects to and from a DLL.
    // It's not necessary if you do not want to export this class for input in other DLLs:

    I hope this helps.

  4. #4
    Join Date
    Oct 2006

    Re: Simple class declaration question

    This is a DLL export macro definition.
    Search in your code for the definition of 'ClassA' - you will probably find an entry such as this one:
    #define ClassA __declspec( dllexport )
    See this for explanation on exporting functions / classes from a DLL.


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)