View Issue Details

IDProjectCategoryView StatusLast Update
0005505JEDI VCL00 JVCL Componentspublic2011-06-07 17:44
ReportermartinitAssigned Toobones 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionduplicate 
Product Version 
Target VersionFixed in Version 
Summary0005505: JvGnuGettext.pas ... Function IsLibrary vs. ModuleIsLib
DescriptionIn Initialization section of jvgnugettext.pas is used variable IsLibrary which is defined in SYSTEM unit. This variable IsLibrary is used in this test ...

  if IsLibrary then
  begin
    // Get DLL/shared object Filename
    SetLength(ExecutableFilename, 300);
    {$ifdef MSWINDOWS}
    SetLength(ExecutableFilename, GetModuleFileName(HInstance,
      PChar(ExecutableFilename), Length(ExecutableFilename)));
    {$endif}
    {$ifdef LINUX}
    // This line has not been tested on Linux, yet, but should work.
    SetLength(ExecutableFilename, GetModuleFileName(0, PChar(ExecutableFilename),
      Length(ExecutableFilename)));
    {$endif}
    {$ifdef CLR}
    ExecutableFilename := System.Diagnostics.Process.GetCurrentProcess.MainModule.FileName;
    {$endif}
  end
  else
    ExecutableFilename := ParamStr(0);

Unfortunately this variable have bad value, when is used in library ... Variable is GLOBAL ... so if i using in DLL, then result is False, because variable tests *.exe file, not *.dll ...

Much better is variable ModuleIsLib which is defined in unit SYSINIT ... this variable detect Library or package in which is jvgnugettext.pas used good.

Thanks for fixing
TagsNo tags attached.

Activities

obones

2011-06-07 17:44

administrator   ~0018605

Duplicate

Issue History

Date Modified Username Field Change
2011-03-03 09:51 martinit New Issue
2011-06-07 17:44 obones Note Added: 0018605
2011-06-07 17:44 obones Duplicate ID 0 => 5496
2011-06-07 17:44 obones Status new => resolved
2011-06-07 17:44 obones Resolution open => duplicate
2011-06-07 17:44 obones Assigned To => obones