1st my code. I really don't know why this is happening. Everything was fine until I thought about preventing my mesh from leaving the terrain (I controle a mesh (box) that moves on an empty terrain). So it has absolutely nothing to do with the initialization. I didn't change anything until the mainloop.
2nd the headers. No, I do not generate them. I only imported the DLL (ActiveX). So everything is autogenerated. And as I said: everything already worked. COM/OLE Class is registered!
Code you could need (this is a DLL!):
procedure Initcomps;
begin
// Init components
// if I put a "Showmessage('123');" here it works on my computer others will also see this dialog, but then fail
ShowCursor(false);
TV := CoTVEngine.Create; // yeeees, I call CoTVEngine here. So what is the problem?
Scene := CoTVScene.Create;
graphics := CoTVGraphicEffect.Create;
_id := CoTVDeviceInfo.Create;
Globals := CoTVGlobals.Create;
_Text := CoTVScreen2DText.Create;
Input := CoTVInputEngine.Create;
intobj := CoTVInternalObjects.Create;
cam := CoTVCamera.Create;
atmo := CoTVAtmosphere.Create;
tex := CoTVTextureFactory.Create;
icam := CoTVCameraFactory.Create;
light := CoTVLightEngine.Create;
pack := CoTVPackage.Create;
_2D := CoTVScreen2DImmediate.Create;
physic := CoTVPhysics.Create;
land := Scene.CreateLandscape('testland');
end;
procedure init;
begin
Randomize;
// Load IniFile
ini:=TIniFile.Create(ExtractFilePath(ParamStr(0))+'options.ini');
readini; // this is for loading game options like resolution etc.
// Engine init
Initcomps;
// some other things are initialized....
end;
procedure thisgame(const PW: PChar);
begin
// SOME CODE HERE: serialnumber-system - works - so everything until here is ok
init;
_2D.Load_Background(pack.GetFile('loading.jpg',graphicpak),False);
// main loop
while _end=False do
begin
if TV.IsFullscreen=False then if frm.Visible=False then _end:=True;
if(PeekMessage( Msg, 0, WM_NULL, WM_NULL, PM_REMOVE ) ) then
begin
TranslateMessage( Msg );
DispatchMessage( Msg );
end
else
begin
if gameinited=False then
Main;
if gameinited=True then
begin
if _loading=False then
Maingame;
if _loading then
initgame;
end;
end;
end;
if smenu=True then
dimout
else
dimoutgame;
Endscreen;
Sleep(1000);
ini.Free;
TV:=nil;
TerminateProcess(GetCurrentProcess,0);
end;
exports thisgame;