Hi!
Ich hab mich auch dazu entschlossen meine eigene Engine zu schreiben. Doch da gibt's Probleme. Beim Aufruf, was in die Log-Datei was zu schreiben kommt das da:
Eine Ausnahme (erste Chance) bei 0x10013dac (BlueCore.dll) in BlueCoreConsoleTest.exe: 0xC0000005: Zugriffsverletzung-Leseposition 0x00000068.
Unbehandelte Ausnahme bei 0x10013dac (BlueCore.dll) in BlueCoreConsoleTest.exe: 0xC0000005: Zugriffsverletzung-Leseposition 0x00000068.
in der Datei output.c
Die Datei bcLogFile.cpp sieht so aus:
|
Quellcode
|
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
26
27
28
29
|
#include "BlueCore.h"
FILE* LogFile = NULL;
BLUECORE_API bcResult bcWriteToLog(char TextToWrite)
{
if(LogFile == NULL) return BC_ERROR;
fprintf(LogFile, "%s", TextToWrite);
return BC_OK;
}
BLUECORE_API bcResult bcInitLog()
{
LogFile = fopen("BlueCore_Engine LogFile.html", "wc");
if(LogFile == NULL) return BC_ERROR;
//fprintf(LogFile, "%s", "<html><head><title>BlueCore_Engine LogFile</title></head><basefont face=\"Eurostile Extended\" size=\"4\">¤BlueCore_Engine¤<br>");
return BC_OK;
}
BLUECORE_API bcResult bcExitLog()
{
fflush(LogFile);
fclose(LogFile);
return BC_OK;
}
|
Die Datei bcLogFile.h sieht so aus:
|
Quellcode
|
1
2
3
4
5
|
extern FILE* LogFile;
BLUECORE_API bcResult bcWriteToLog(char TextToWrite);
BLUECORE_API bcResult bcInitLog();
BLUECORE_API bcResult bcExitLog();
|
Und der Aufruf sieht so aus:
|
Quellcode
|
1
2
3
4
5
|
bcInitLog();
bcWriteToLog('h');
bcExitLog();
|
Wie kann man ausserdem festlegen, dass nicht nur ein char sondern auch ein char-Array übergeben werden kann??