[fpc-pascal] TEventLog, RegisterMessageFile and {$R fclel.res}

Reinier Olislagers reinierolislagers at gmail.com
Sat Feb 16 12:46:44 CET 2013


On 16-2-2013 12:26, Michael Van Canneyt wrote:
> On Sat, 16 Feb 2013, Reinier Olislagers wrote:
>> Decided I liked/needed that and did this:
>>
>> {$R fclel.res}
>> ...
>> FLog.RegisterMessageFile('');
> 
> That should be ParamStr(0) instead of empty string.
Are you sure? FPC 2.6.0:
Function TEventLog.RegisterMessageFile(AFileName : String) : Boolean;
...
      If AFileName='' then
        AFileName:=ParamStr(0);

If so, then perhaps the help should be edited
"If AFileName is empty, the filename of the application binary is
substituted."?


>> However, on compiling I get a "can't open resource file" error.
>>
>> Is copying over
>> ($fpcdir)\fcl-base\src\win\fclel.res
>> to the application directory the best solution?
> 
> It is by far the easiest.
Ok, thanks, Michael!



More information about the fpc-pascal mailing list