-
Notifications
You must be signed in to change notification settings - Fork 55
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
Memo generates access violation error #18
Comments
@Ariel-MN thank you to report. I will have a look on it. |
I tested with the same code you sent and found no such error. I even added one more style and printed them to the Memo. Please find the code and the GUI output result image. import os
from delphivcl import *
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
class MainForm(Form):
def __init__(self, owner):
self.Caption = "Test Memo"
self.SetBounds(10, 10, 500, 400)
self.Position = "poScreenCenter"
# Memo component
self.txtMemo = Memo(self)
self.txtMemo.SetProps(Parent=self)
self.txtMemo.SetBounds(10, 40, 300, 100)
# Auto-load new style
self.__sm = StyleManager()
self.__load_style()
self.txtMemo.Lines.Add(f"Number of loaded styles: {len(self.__sm.StyleNames)}")
self.txtMemo.Lines.Add("The loaded Styles are:")
self.txtMemo.Lines.Add(self.__sm.StyleNames[0])
self.txtMemo.Lines.Add(self.__sm.StyleNames[1])
self.txtMemo.Lines.Add(self.__sm.StyleNames[2])
def __load_style(self):
self.__sm.LoadFromFile(os.path.join(BASE_DIR, "Windows10SlateGray.vsf"))
self.__sm.LoadFromFile(os.path.join(BASE_DIR, "SapphireKamri.vsf"))
self.__sm.SetStyle(self.__sm.StyleNames[2])
def main():
Application.Initialize()
Application.Title = "Checking DelphiVCL4Python"
Main = MainForm(Application)
Main.Show()
Application.Run()
Main.Destroy()
if __name__ == '__main__':
main() The error is because you might not have permission to access the |
Okay, fine. Thanks for more details. @Ariel-MN you meant that this error is getting generated when using the |
Absolutely. The error only happens with the Memo component and not with others and I have tried with several styles obtaining the same result. |
Weird! You can see it running without any issue in the reply I posted above right? Maybe, we'll need to simulate your exact environment (OS and python version) and try it once. Will get back with more news as we figure out anything new on this. Thank you so much and we appreciate you keep trying and testing more. |
Most likely something regarding the Win 11. Are you using Python x86 or x64? |
@Priyatham10 You are very welcome. Unfortunately your script produced the same result as mine in both of my environments.
|
@Ariel-MN I will try to simulate in a similar environment as yours. |
@Ariel-MN are you still facing such error? I can't reproduce it here. |
@lmbelo yes, i still have the same problem. |
@Ariel-MN I really can't reproduce this issue. I have tried in Win 11 and even in Win 10, it's working in both. |
@lmbelo If it can be useful I can offer you access through teamviewer to one of my environments. |
@Ariel-MN It would be great. |
I was finally able to reproduce this issue under Python x64 architecture. It does run well under Python x86. |
I realized this is something regarding the new ComCtrls library. It occurs when the SystemStyle is enable, which may happen when using a comctrls32.dll >= 393216. |
I have the workaround done. I hope to get it available in our next release. |
That's very good news. I'll be waiting for the new version. Thank you. |
A new release is available 🚀 Can you try again, please? |
@lmbelo, fixed in version 1.0.39, although this new version seems to have broken compatibility with the new Class TNumberBox added in v. 1.0.38. |
Thank you to report @Ariel-MN. I will investigate this case. |
@Ariel-MN a new version containing the TNumberBox fix is out. Can you try again? |
@lmbelo, now everything works perfectly. Even other High DPI related issues have been fixed with Delphi 11. |
Fabulous 🚀 Can we close this issue? |
Sure, go ahead. |
The Memo component generates an access violation error after changing the style of the application.
Example code:
The text was updated successfully, but these errors were encountered: