Attila Kovacs 629 Posted January 17 Any thoughts about how this should be patched until it's fixed? https://www.delphipraxis.net/1530328-post10.html I have started to receive error reports on that. Share this post Link to post
Dalija Prasnikar 1396 Posted January 17 Error happens when CM_RELEASE is sent to a form. The fix is to avoid calling VisualManager in that scenario. Instead in WndProc, you can also add check in VisualManager_AcceptMessage method before the code within tries to access FVisualManagerInitialized field. procedure TCustomForm.WndProc(var Message: TMessage); ... inherited WndProc(Message); if (Message.Msg <> CM_RELEASE) and VisualManager_AcceptMessage(Message) then VisualManager_WndProc(Message); end; 1 Share this post Link to post
Attila Kovacs 629 Posted January 17 @Dalija Prasnikar Ok, I see now where the problem is. However, since VisualManager_AcceptMessage is not virtual, the only way to fix that without adding a patched Vcl.Forms to the project is to handle CM_RELEASE without calling the WndProc... As I always use a common form, this should be manageable. I just have to examine what CM_RELEASE should do... let's see. Thank you Share this post Link to post
Dalija Prasnikar 1396 Posted January 17 1 minute ago, Attila Kovacs said: @Dalija Prasnikar Ok, I see now where the problem is. However, since VisualManager_AcceptMessage is not virtual, the only way to fix that without adding a patched Vcl.Forms to the project is to handle CM_RELEASE without calling the WndProc... As I always use a common form, this should be manageable. I just have to examine what CM_RELEASE should do... let's see. CM_RELEASE is simple procedure TCustomForm.CMRelease; begin Free; end; Yes, you can intercept it in your form. Share this post Link to post
Attila Kovacs 629 Posted January 17 (edited) Ok, CM_RELEASE has no job in form's wnd proc, I have to hop to TWinControls WndProc Edited January 17 by Attila Kovacs Share this post Link to post
Dalija Prasnikar 1396 Posted January 17 (edited) 4 minutes ago, Attila Kovacs said: Ok, CM_RELEASE has no job in form's wnd proc, I have to hop to TWinControls WndProc It is directly dispatched in TCustomForm through procedure CMRelease(var Message: TMessage); message CM_RELEASE; Edited January 17 by Dalija Prasnikar 1 Share this post Link to post
Attila Kovacs 629 Posted January 17 I'll go with this, until it's fixed. // D12 caFree patch // https://www.delphipraxis.net/1530328-post10.html // https://quality.embarcadero.com/browse/RSP-43547 procedure TCForm.WndProc(var Message: TMessage); begin if message.Msg = CM_RELEASE then Dispatch(message) else inherited WndProc(message); end; Let this example stand as a sign of how beneficial it is to always use a common form. 1 Share this post Link to post