Hello,
i am working at an dll at the moment which shows an VCL form with advsmoothbuttons and an advsmoothtouchkeyboard.
While working with the dll i noticed that under some circumstances the dll raises an error when it is freed.
The error occurs only if you load and free the libary dynamically, and in formcreate of mainprogramm.
You then get a few access violations followed by an runtime error 216.
With static binding the error doesn't occurs.
To raise the error its enough to put one of the advsmooth... units in the uses clause of the dll and call an dll function with dynamic loading in formcreate of mainprogramm.
I have made an demo to demonstrate this behaviour, but found no functionality for adding an File to forum post.
How can i submit the demo to you?
Hi,
We have tested your sample here and are not able to reproduce this.
Can you verify you are using the latest version? Make sure your system is clean of old source files
and then reinstall
the latest version
Hello,
I installed latest version yesterday, problem still occurs.
But i may have found an possible solution what throws the exceptions.
The problem may have to do with GDI+.
I found out if i change the following code in AdvGdip.pas
from
finalization
begin
// Close GDI +
if not IsLibrary then // remove this line when the caller of the DLL or Active has NOT initialized GDI+
begin
if not IsWinVista then
StartupOutput.NotificationUnhook(gdiplusToken);
GdiplusShutdown(gdiplusToken);
end;
end;
to
finalization
begin
// Close GDI +
//if not IsLibrary then // remove this line when the caller of the DLL or Active has NOT initialized GDI+
//begin
if not IsWinVista then
StartupOutput.NotificationUnhook(gdiplusToken);
GdiplusShutdown(gdiplusToken);
//end;
end;
then the exceptions are gone.
So there are my questions:
Do i have to take care of any GDI+ Initialization/finalization if i use Adv... components in an DLL?
May it be possible that there is something wrong with GDI+ Initialization/finalization if i use the components in an DLL with dynamic binding?
Was explained by direct email.