[Lazarus] user information of failure during initialization phase

Maik Wojcieszak maikwo at googlemail.com
Tue Aug 31 10:38:47 CEST 2010


I've found a solution the works for windows.

//----------------------------------------------
// show a message and terminate the application
//----------------------------------------------
procedure InitError(amsg : AnsiString);
begin
   MessageBox(0,PChar(amsg),'sidex dll error',MB_ICONERROR);
   Halt(1); // terminate application
end;

This works for me now in windows. I need to develop it maybe while 
porting to Linux and MacOSx.
Only the direct windows API call works here, because the application is 
not initilized at this point.
A conditional compile to use a writeln for console application might be 
useful too.


waldo kitty schrieb:
> On 8/31/2010 02:49, Maik Wojcieszak wrote:
>> Hi,
>>
>> I am working with
>>
>> Lazarus IDE v0.9.28.2 Beta
>> MS Windows XP Prof DE sp3
>> FPC Version 2.2.4
>>
>> I try do dynmaically load a dll during initialization phase. This can 
>> cause
>> exceptions if the dll is not available or
>> the interface is not matching. Raising an exception at this point 
>> causes my
>> application to terminate without any message.
>>
>> Using "ShowMessage" is not possible. How can I inform the user about 
>> the problem
>> before terminating ?
>
> isn't there a way to check that the dll is available before attempting 
> to load it?
>
> i don't know what to possibly do or suggest about the interface not 
> matching...
>
> -- 
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>





More information about the Lazarus mailing list