[fpc-pascal] Unit initialization in dll initialization for arm/WinCE
Sven Barth
pascaldragon at googlemail.com
Tue Jun 12 18:04:13 CEST 2012
Am 12.06.2012 15:20 schrieb "kyan" <alfasud.ti at gmail.com>:
>
> OK, I apologize. It seems that the problem lies elsewhere. The fact
> that library initialization seems to be deferred until you do a
> GetProcAddress() confused me.
It might't be that Windows (or CE only) initalizes a library only if you
use GetProcAddress at least once... I have not tested that, but it might be
an idea. If that is the case we can not influence that.
> The problem is that function
> GetModuleName() is stubbed out in WinCE (and Linux):
>
> unit SysUtils.inc;
>
> function GetModuleName(Module: HMODULE): string;
> begin
> {$ifdef MSWINDOWS}
> SetLength(Result,MAX_PATH);
> SetLength(Result,GetModuleFileName(Module,
Pchar(Result),Length(Result)));
> {$ELSE}
> Result:='';
> {$ENDIF}
> end;
>
> The function GetModuleFileName() exists (although it is unicode) in
> WinCE: http://msdn.microsoft.com/en-us/library/ms908441.aspx
>
> And from what I've found in the web a Linux implementation is possible
> using dladdr().
If you want you can create a bug report. WinCE might likely be solved then,
but I can't comment on Linux or other *nix systems.
Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20120612/5c823e73/attachment.html>
More information about the fpc-pascal
mailing list