Hi
Also ich bin echt am verzeifeln und ich weiß einfach nicht woran das liegt:
Also ich habe folgende KLasse:
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
class CT_API App;
class CT_API Graphics;
class CT_API Core
{
friend class App;
friend class Graphcis;
public:
inline static App& GetApp() { return (*m_AppInstance); }
inline static Graphcis& GetGraphics() { return (*m_GraphicsInstance); }
inline static HMODULE DllModule() { return (m_DllModule); }
inline static HINSTANCE PInstance() { return (m_ProgramInstance); }
inline static bool HasApp() { return ToBool(m_AppInstance); }
inline static bool HasGraphics() { return ToBool(m_GraphicsInstance); }
private:
static App* m_AppInstance;
static Graphcis* m_GraphicsInstance;
static HMODULE m_DllModule;
static HINSTANCE m_ProgramInstance;
};
|
So mein Erstes Problem ist, dass bei
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
|
Graphics::Graphics()
{
if(Core::HasGraphics())
CT_EXCEPTION_LOG(ct::exp::AlreadyExistException, "An Instance of Graphics already exists !");
Core::m_GraphicsInstance = this; // <- Hier kommt der Fehler
CT_INFO_LOG("Create Direct3D...");
m_Direct3D = Direct3DCreate9(D3D_SDK_VERSION);
CT_CHECK(m_Direct3D, "Can not create Direct3D !", CT_EXCEPTION(exp::Direct3DException));
}
|
Da kommen folgende Fehler:
graphics.cpp(16) : error C2248: 'ct::Core::m_GraphicsInstance' : cannot access private member declared in class 'ct::Core'
core.h(29) : see declaration of 'ct::Core::m_GraphicsInstance'
core.h(14) : see declaration of 'ct::Core'
graphics.cpp(16) : error C2440: '=' : cannot convert from 'ct::Graphics *const ' to 'ct::Graphcis *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Und dann gibt es in der Graphic-klasse eine instance-methode:
|
C-/C++-Quelltext
|
1
|
inline static Graphics& Inst() { return Core::GetGraphics(); }
|
Und da kommt jetzt seltsamerweise folgender Fehler:
graphics.h(37) : error C2440: 'return' : cannot convert from 'ct::Graphcis' to 'ct::Graphics &'
Das sind alle irgendwie komische Fehler... aber noch lustiger is es, weil die App-klasse genau so programmiert ist und die funktioniert ausnahmslos...
Also ich weiß nicht mehr weiter... vlt habt ihr ja ein paar Ideen ?....