Hi
A friend and I are 'simply' trying to use TPicture.Create but the creation keep failing with an exception. We are using it as part of a DLL project. Not a standard application. I tried changing the widgetset to fpNoGui instead of the standard "Win32" in case that was the reason for rsNoWidgetSet being passed. But then it wouldn't compile saying fpg_main fpguicrosshelpers couldn't be found and I couldn't find fpg_main in the package list. I tried adding "LCL" package to the project dependancy. LCLBase was already in it.
var
MyPic : TPicture;
begin
...
MyPic := TPicture.Create; // *** FAILS
...
end;
Going through the debugger, the problem arises on line 185 of LCLIntf in PredefinedClipboardFormat, after the call to TPicClipboardFormats.Create by TPicture.Create
function PredefinedClipboardFormat(AFormat: TPredefinedClipboardFormat): TClipboardFormat;
begin
if FPredefinedClipboardFormats[AFormat]=0 then begin
if WidgetSet=nil then
raise Exception.Create(rsNoWidgetSet); // *** EXCEPTION RAISED HERE *** WidgetSet does equal 0
FPredefinedClipboardFormats[AFormat]:=
ClipboardRegisterFormat(PredefinedClipboardMimeTypes[AFormat]);
end;
Result:=FPredefinedClipboardFormats[AFormat];
end;
If I create a new, blank project, and call it, it works fine.
Can anyone help me work out where to go next here? I can't for the life of me see what it is failing.