Well... Don't do that at home, kids... :x

In the host app:

[pascal]
Procedure Die(YellID :TMessageID; Param: array of const);
var
U: WideString;
Ey: AnsiString;
begin
U:=PervertedFormat(MessageContainer[YellID], Param);
if not Dying then begin
CheckForGenericDyingYells(U);
AddLog(MI_SHIT_HAPPENS_SEE_BELOW, [EChar]);
Dying:=Yes;
end;
Ey:=WideToAnsi(U);
WarningQueue.Add(U);
RaiseSystemException;
end; [/pascal]

In the module dll:
[pascal] procedure TModule.OnCycle;
begin
PrevFrameTime:=FrameTime;
f_FrameTime:=0.0;
if Assigned(Menu) then Menu.Cycle;
if Assigned(Game) and not GamePaused then Game.Cycle(PrevFrameTime);
if Assigned(Game) then try
Game.Render;
except
AddLog(RuEn(
'Крах при отрисовке игрового мира...'
,'Game render crashed...'));
try
SaveSession;
except
Die(RuEn(
'Крах при отрисовке игрового мира.'#10#13'Песец, аварийное сохранение не удалось '
,'Game render crashed.'#10#13'Emergency save attempt failed '))
end;
Die(RuEn(
'Крах при отрисовке игрового мира.'#10#13'Аварийное сохранение удалось! '
,'Game render crashed.'#10#13'Emergency save sucsess! '))
end
else RenderBackground;
if Assigned(Menu) then Menu.Render;
end;[/pascal]

In the host app's function used by the module DLL:
[pascal] procedure CgeFilePropByType(t: AnsiChar; name: PAnsiChar);
begin
C.Header^.sign:='CGE';
{$ifndef fpc}
if t='s' then t:='0';
{$endif}
Case t of
'0': with C do begin
Compression:=cfc_None;
DoMd5:=No;
end;
's': with C do begin
Compression:=cfc_None;
DoMd5:=Yes;
end;
else
Die(MI_CGEFILE_UNSUPPORTED, [Name, 'CGE' + t])
end;
end;[/pascal]

How else could it be done?

...aaand we have deviated from the topic, going straight in the "your projects" direction.