-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Application crashes while using DLL which is setting VCL Style #306
Comments
Hello, I don't think VCL Style utlis can fix this, it is more focused on drawing. Your application crashes because styles were not designed with DLL in mind. Styles code refers to an Mainform that does not exist inside the DLL. It s set to nil so you crash when using styles. But there is a workaround, I successfully uses styles and dll. You need to create a fake empty mainform like this : procedure AtaDLLinterface(App: TApplication; WParamAppli: TparamAppli; Wdata: pointer); AtaMemHandle := Application.Handle; // Gestion multi moniteurs, rétabli le moniteur actif courant de l'application
finally hope it Helps |
Hi,
I am upgrading a Delphi application that uses DLL libraries. I have upgraded the application and DLLs from XE2 to 11.3. For this, I included the latest VCL Styles utils. The application and DLLs set styles. I put the set style functionality in a common unit and used it in both applications and DLLs. Following is the function for set style.
`Procedure LoadStyle();
var
UserStyle : String;
FullUserStyle : String;
Begin
// Check Style in User Registry.
UserStyle := GetLocalUserStyle();
FullUserStyle := Format( '%sStyles%s.vsf', [ExtractFilePath(Application.ExeName), UserStyle] );
if FileExists( FullUserStyle ) then
TStyleManager.SetStyle(TStyleManager.LoadFromFile(FullUserStyle));
End;`
This function is called at initialization of that common unit.
The issue is that my application crashes when a DLL is being used. The DLL has a dialog to show and also has another functionality.
Can you please help me to investigate what could be the issue?
The text was updated successfully, but these errors were encountered: