Forum > Beginners
Trying to load an Icon file and get an access violation ..
(1/1)
Dasun:
All, appreciate some help here ..Evaluating fpgui toolkit and need to load an icon file. I thought the following code snippet would do but I get an access violation error - The Icon file exists, it is a windows icon file - copied from a windows machine - and I can not find out why LoadFromFile blows up after a real good dig - any ideas appreciated.
===C ode Snippet
Test : Ticon ;
.
.
.
Test := TIcon.Create() ;
Test.LoadFromFile(test.ico');
fpgImages.AddBMP('mainicon', Test.RawImage.Data , Test.RawImage.DataSize);
Error message
===========
Project xxxx raised exception class 'External: SIGSEGV'.
In file 'include/winapi.inc' at line 485
Dasun:
Bit more information ... I am running on Linux Mint...
So when I try to load an Icon file..with test.LoadFromFile
A number of functions to load the Icon file are called but the the trouble starts with In Icon.inc ...
class function TCustomIcon.GetDefaultSize: TSize;
begin
Result := Size(GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON));
end;
Which calls
In winapi.inc
function GetSystemMetrics(nIndex: Integer): Integer;
begin
Result := WidgetSet.GetSystemMetrics(nIndex); ///AND BOOM - A SEG V
end;
So what is the go? Is GetSystemMetrics not defined for the widgetset ?
Appreciate any help...
Navigation
[0] Message Index