[vc++] Using an external class

Joined
Jul 13, 2007
Messages
923
Reaction score
320
I have this problem:
in b.h
Code:
class ThisIsIt {
public:
    void aaa();
    void bbb();
    void ccc();
    void ddd();

private:
    void x();
    bool z(DWORD asd);
};
and i need to use some of voids in other cpp than b.cpp and i tried to do like this
a.h
Code:
extern "C++"
   {
        class ThisIsIt
        {
            public:
                void aaa();
                void bbb();
                void ccc();
                void ddd();
        };
    }
and if i do like this when it come to use the external class the application crash.
I never worked before with external class so i don't know where the mistake can be...

Thanks is advance!
 
What do you mean an "external class" ? Are you just trying to use some code in several CPP files or do you want to export a class through a DLL to another application?

In the first case just add
Code:
#include "b.h"
in a.h.
 
Last edited:
Back