tmcdos
29-Jul-2011, 09:12 AM
I have just installed EurekaLog 6.1.0.2 and tried to rebuild my project with option Use EurekaLog 7 compiler - but IDE closes itself without any exception dialogs. Without option Use EurekaLog 7 compiler compilation is successful.
The reason for this is that I installed EurekaLog manually, bypassing the installer - so there was no Base Directory written into the registry and CreateProcess in EBaseModule.ExecWait() fails.
The fix is:
....
if not CreateProcess({Pointer(App)}NIL, PChar(CommandLine), nil, nil, False,
CREATE_DEFAULT_ERROR_MODE or BELOW_NORMAL_PRIORITY_CLASS or Flags, nil, nil,
StartInfo, ProcInfo) then
.....
function BaseDir: AnsiString;
var
ModuleFileName: PChar;
begin
ModuleFileName:=Nil; // IVO GELOV
Result := ReadKey(HKEY_CURRENT_USER, '\Software\EurekaLog', 'AppDir');
if (Result <> '') then // With EurekaLog installation...
Result := (Result + '\')
else
// ==== IVO GELOV ====
try
GetMem(ModuleFileName,MAX_PATH+1);
if ModuleFileName<>Nil then
begin
GetModuleFileName(hInstance,ModuleFileName,MAX_PAT H);
Result:=ExtractFilePath(ExtractFileDir(String(Modu leFileName)));
end;
finally
if ModuleFileName<>Nil then FreeMem(ModuleFileName,MAX_PATH+1);
end;
// ==== end IVO GELOV ====
end;
-----------------
Edit: By the way, when I recompiled my application with EL 6.1.0.2 instead of 6.0.25 - application size increases with more than 130 KBytes.
The reason for this is that I installed EurekaLog manually, bypassing the installer - so there was no Base Directory written into the registry and CreateProcess in EBaseModule.ExecWait() fails.
The fix is:
....
if not CreateProcess({Pointer(App)}NIL, PChar(CommandLine), nil, nil, False,
CREATE_DEFAULT_ERROR_MODE or BELOW_NORMAL_PRIORITY_CLASS or Flags, nil, nil,
StartInfo, ProcInfo) then
.....
function BaseDir: AnsiString;
var
ModuleFileName: PChar;
begin
ModuleFileName:=Nil; // IVO GELOV
Result := ReadKey(HKEY_CURRENT_USER, '\Software\EurekaLog', 'AppDir');
if (Result <> '') then // With EurekaLog installation...
Result := (Result + '\')
else
// ==== IVO GELOV ====
try
GetMem(ModuleFileName,MAX_PATH+1);
if ModuleFileName<>Nil then
begin
GetModuleFileName(hInstance,ModuleFileName,MAX_PAT H);
Result:=ExtractFilePath(ExtractFileDir(String(Modu leFileName)));
end;
finally
if ModuleFileName<>Nil then FreeMem(ModuleFileName,MAX_PATH+1);
end;
// ==== end IVO GELOV ====
end;
-----------------
Edit: By the way, when I recompiled my application with EL 6.1.0.2 instead of 6.0.25 - application size increases with more than 130 KBytes.