cnwizards icon indicating copy to clipboard operation
cnwizards copied to clipboard

D11 Alexandria and 1.2.1.1066 canvas does not allow to draw on error

Open lchris789 opened this issue 3 years ago • 14 comments

Hello, I wish you all a happy new year !

I still have an isssue with cnpack.

It happens only when there is an error in source code and compilation fails with errors.

it can be any error, a simple syntax error will do.

Then I get the message "Canvas does not allow to draw"

If compilation succeeds everything is fine.

Do you do something special when compilation ends in error ?

best regards chris

lchris789 avatar Jan 04 '22 16:01 lchris789

Thanks for your report. Is there any stack trace in exception details when this error occurs?

shanzhashu avatar Jan 04 '22 23:01 shanzhashu

Hi shanzhashu,

Stack trace is below, but I can reproduce it very easily now, can you try the following steps with D11 please ?

Open D11 with latest cnpack installed select File - new Windows VCL application on the right in the project dproj panel, right click on project1.exe and select "Show source" in the list in the main program source find the line Application.CreateForm(TForm1, Form1); insert an error and change it to Application.CreateForm(TFofrm1, Form1); (notice the added f chraracter in TFofrm1) Do a full build Here I allways get "Canvas does not allow drawing" after compile fails in error

[50CA30B3]{vcl280.bpl } Vcl.Graphics.OutOfResources (Line 4422, "Vcl.Graphics.pas" + 1) + $1C [50CA315A]{vcl280.bpl } Vcl.Graphics.GDIError (Line 4448, "Vcl.Graphics.pas" + 13) + $0 [50CA318F]{vcl280.bpl } Vcl.Graphics.GDICheck (Line 4453, "Vcl.Graphics.pas" + 1) + $4 [50CA8B33]{vcl280.bpl } Vcl.Graphics.CopyBitmap (Line 7844, "Vcl.Graphics.pas" + 20) + $9 [5006076C]{rtl280.bpl } System.TMonitor.Destroy (Line 19558, "System.pas" + 0) + $0 [5005FEBD]{rtl280.bpl } System.TObject.CleanupInstance (Line 18260, "System.pas" + 23) + $0 [5005A388]{rtl280.bpl } System.@FreeMem (Line 4976, "System.pas" + 20) + $0 [5005FCE4]{rtl280.bpl } System.TObject.FreeInstance (Line 17960, "System.pas" + 2) + $2 [500604B2]{rtl280.bpl } System.@ClassDestroy (Line 19324, "System.pas" + 0) + $2 [5005FDDC]{rtl280.bpl } System.TObject.Free (Line 18023, "System.pas" + 1) + $4 [50CA8420]{vcl280.bpl } Vcl.Graphics.TSharedImage.Release (Line 7487, "Vcl.Graphics.pas" + 7) + $2 [50CAA756]{vcl280.bpl } Vcl.Graphics.TBitmap.NewImage (Line 9171, "Vcl.Graphics.pas" + 36) + $5 [50CA95E3]{vcl280.bpl } Vcl.Graphics.TBitmap.CopyImage (Line 8212, "Vcl.Graphics.pas" + 13) + $F [50CAB79B]{vcl280.bpl } Vcl.Graphics.TBitmap.SetSize (Line 9988, "Vcl.Graphics.pas" + 10) + $9 [50CAAFDF]{vcl280.bpl } Vcl.Graphics.TBitmap.SetHeight (Line 9577, "Vcl.Graphics.pas" + 1) + $A [32A73CBC]{DataSetManager280.bpl} Dsmidecntrllist.TIDEControlList.Load + $80C [32A73F69]{DataSetManager280.bpl} Dsmidecntrllist.TIDEControlList.Load + $AB9 [32A73EA2]{DataSetManager280.bpl} Dsmidecntrllist.TIDEControlList.Load + $9F2 [32A7420B]{DataSetManager280.bpl} Dsmidecntrllist.TIDEControlList.InternalLoad + $87 [32A734BF]{DataSetManager280.bpl} Dsmidecntrllist.TIDEControlList.Load + $F [32A74831]{DataSetManager280.bpl} Dsminteropservices.TDsmInteropServices.CreateObjects + $69 [32A95381]{DataSetManager280.bpl} Dsmservicesproxy.TDsmApiProxy.OnFileNotification + $2C1 [32A86C6E]{DataSetManager280.bpl} Dsmclasses.TIdeNotifier.FileNotification + $2E [207A0755]{coreide280.bpl} IDEServices.TIDEServices.SendFileNotification (Line 5289, "IDEServices.pas" + 8) + $10 [207A0E0E]{coreide280.bpl} IDEServices.FileNotification (Line 5549, "IDEServices.pas" + 1) + $9 [2079E79B]{coreide280.bpl} IDEServices.TIDEServices.ActiveProjectChanged (Line 4335, "IDEServices.pas" + 2) + $2F [20F0AE5D]{designide280.bpl} Events.TEvent.Send (Line 154, "Events.pas" + 2) + $11 [204B9509]{coreide280.bpl} ProjectGroup.TProjectGroup.ActivateProject (Line 616, "ProjectGroup.pas" + 35) + $14 [204C0E65]{coreide280.bpl} ProjectGroup.TProjectGroupWrapper.ActivateProject (Line 2824, "ProjectGroup.pas" + 0) + $5 [204C0EAF]{coreide280.bpl} ProjectGroup.TProjectGroupWrapper.ActivateProject (Line 2833, "ProjectGroup.pas" + 3) + $5 [20492B40]{coreide280.bpl} ProjectGroupBuilder.TProjectGroupBuilder.PostBuild (Line 395, "ProjectGroupBuilder.pas" + 15) + $E [2048A2CE]{coreide280.bpl} BuildHost.TBuildHost.AfterBuild (Line 401, "BuildHost.pas" + 2) + $8 [204922D8]{coreide280.bpl} ProjectGroupBuilder.TProjectGroupBuilder.DoBuild (Line 187, "ProjectGroupBuilder.pas" + 3) + $16 [2048A15D]{coreide280.bpl} BuildHost.TBuildHost.Perform (Line 375, "BuildHost.pas" + 25) + $3 [2047718A]{coreide280.bpl} ComPrgrs.TProgressForm.StartCompile (Line 238, "ComPrgrs.pas" + 8) + $C [53923869]{DDevExtensionsD110.dll} Fonction inconnue à __dbk_fcall_wrapper + $21EA9 [20477C7E]{coreide280.bpl} ComPrgrs.TProgressForm.HandleCompileMessage (Line 462, "ComPrgrs.pas" + 0) + $2 [50CC7CCA]{vcl280.bpl } Vcl.Controls.TControl.WndProc (Line 7544, "Vcl.Controls.pas" + 91) + $6 [5006076C]{rtl280.bpl } System.TMonitor.Destroy (Line 19558, "System.pas" + 0) + $0 [50064774]{rtl280.bpl } System.@FinalizeRecord (Line 32815, "System.pas" + 76) + $2 [50DCDE65]{vcl280.bpl } Vcl.Themes.TStyleManager.GetStyle (Line 5789, "Vcl.Themes.pas" + 7) + $D [50061544]{rtl280.bpl } System.@TryFinallyExit (Line 23404, "System.pas" + 8) + $0 [50DCDF53]{vcl280.bpl } Vcl.Themes.TStyleManager.GetStyle (Line 5800, "Vcl.Themes.pas" + 18) + $1E [500602C7]{rtl280.bpl } System.TObject.Dispatch (Line 18874, "System.pas" + 11) + $0 [50DD1DCD]{vcl280.bpl } Vcl.Themes.TStyleHook.WndProc (Line 7684, "Vcl.Themes.pas" + 38) + $6 [50DD1FAE]{vcl280.bpl } Vcl.Themes.TMouseTrackControlStyleHook.WndProc (Line 7783, "Vcl.Themes.pas" + 1) + $4 [50E1B28D]{vcl280.bpl } Vcl.Forms.TFormStyleHook.WndProc (Line 18217, "Vcl.Forms.pas" + 7) + $4 [50DD15F2]{vcl280.bpl } Vcl.Themes.TStyleHook.HandleMessage (Line 7389, "Vcl.Themes.pas" + 20) + $6 [50E17213]{vcl280.bpl } Vcl.Forms.TFormStyleHook.IsStyleBorder (Line 16434, "Vcl.Forms.pas" + 1) + $C [50E17254]{vcl280.bpl } Vcl.Forms.TFormStyleHook.HandleMessage (Line 16441, "Vcl.Forms.pas" + 2) + $6 [50EF133E]{vcl280.bpl } Vcl.Styles.TStyleEngine.HandleMessage (Line 3603, "Vcl.Styles.pas" + 22) + $7 [50DCE084]{vcl280.bpl } Vcl.Themes.TStyleManager.HandleMessage (Line 5858, "Vcl.Themes.pas" + 11) + $11 [50CCAE2F]{vcl280.bpl } Vcl.Controls.TWinControl.DoHandleStyleMessage (Line 9408, "Vcl.Controls.pas" + 0) + $F [50CCCDBD]{vcl280.bpl } Vcl.Controls.TWinControl.WndProc (Line 10579, "Vcl.Controls.pas" + 170) + $6 [50E02FA0]{vcl280.bpl } Vcl.Forms.TCustomForm.WndProc (Line 4768, "Vcl.Forms.pas" + 1) + $37 [50E03658]{vcl280.bpl } Vcl.Forms.TCustomForm.WndProc (Line 4989, "Vcl.Forms.pas" + 222) + $5 [50E03670]{vcl280.bpl } Vcl.Forms.TCustomForm.WndProc (Line 4990, "Vcl.Forms.pas" + 223) + $13 [50CCC338]{vcl280.bpl } Vcl.Controls.TWinControl.MainWndProc (Line 10267, "Vcl.Controls.pas" + 3) + $6 [50174218]{rtl280.bpl } System.Classes.StdWndProc (Line 18318, "System.Classes.pas" + 8) + $0 [500647B5]{rtl280.bpl } System.@FinalizeRecord (Line 32824, "System.pas" + 85) + $2 [50E0D743]{vcl280.bpl } Vcl.Forms.TApplication.ProcessMessage (Line 11320, "Vcl.Forms.pas" + 23) + $1 [50E0D786]{vcl280.bpl } Vcl.Forms.TApplication.HandleMessage (Line 11350, "Vcl.Forms.pas" + 1) + $4 [50E08A86]{vcl280.bpl } Vcl.Forms.TCustomForm.ShowModal (Line 7975, "Vcl.Forms.pas" + 50) + $5 [50E08C2C]{vcl280.bpl } Vcl.Forms.TCustomForm.ShowModal (Line 8007, "Vcl.Forms.pas" + 82) + $13 [20489B76]{coreide280.bpl} BuildHost.TBuildHost.Build (Line 231, "BuildHost.pas" + 55) + $9 [2048971F]{coreide280.bpl} BuildHost.Build (Line 136, "BuildHost.pas" + 4) + $B [204920CB]{coreide280.bpl} ProjectGroupBuilder.BuildProjects (Line 146, "ProjectGroupBuilder.pas" + 1) + $18 [205576EC]{coreide280.bpl} ProjectManagerMenus.TPMMBuildProject.Execute (Line 200, "ProjectManagerMenus.pas" + 12) + $21 [2046386A]{coreide280.bpl} ContainerIntf.TProjectManagerMenuItem.Click (Line 1110, "ContainerIntf.pas" + 18) + $22 [50DF076B]{vcl280.bpl } Vcl.Menus.TMenu.DispatchCommand (Line 3576, "Vcl.Menus.pas" + 5) + $2 [50DF19E6]{vcl280.bpl } Vcl.Menus.TPopupList.WndProc (Line 4749, "Vcl.Menus.pas" + 4) + $E [50DF1935]{vcl280.bpl } Vcl.Menus.TPopupList.MainWndProc (Line 4724, "Vcl.Menus.pas" + 2) + $5 [50174218]{rtl280.bpl } System.Classes.StdWndProc (Line 18318, "System.Classes.pas" + 8) + $0 [500647B5]{rtl280.bpl } System.@FinalizeRecord (Line 32824, "System.pas" + 85) + $2 [50E0D743]{vcl280.bpl } Vcl.Forms.TApplication.ProcessMessage (Line 11320, "Vcl.Forms.pas" + 23) + $1 [50E0D786]{vcl280.bpl } Vcl.Forms.TApplication.HandleMessage (Line 11350, "Vcl.Forms.pas" + 1) + $4 [50E0DAC5]{vcl280.bpl } Vcl.Forms.TApplication.Run (Line 11489, "Vcl.Forms.pas" + 27) + $3 [004F6F82]{bds.exe } bds.bds (Line 227, "" + 16) + $2

lchris789 avatar Jan 05 '22 11:01 lchris789

Though I can't reproduce this problem in my workstation,I think it's a general GDI resource problem, which is not directly related to "compile error". I'll try to reduce GDI resources occupied by CnPack.

shanzhashu avatar Jan 07 '22 07:01 shanzhashu

Hi shanzhashu,

Thanks for trying.

Can you make one last attempt please ?

Change CnPack language to French and try my steps again.

Tell me if you see something then ? (I hope you don't need to have the whole delphi in french to make it happen)

lchris789 avatar Jan 07 '22 13:01 lchris789

1.2.2 comes out, which reduce GDI resource usage partly. You can try it.

shanzhashu avatar Apr 06 '22 00:04 shanzhashu

Hello Liu Xiao ! I still have the issue, but not if I reset the parameters, only if I keep old parameters.

I have reduced the search to this part, can you try to import it with regedit than compile anything with a code syntax error ?

[HKEY_CURRENT_USER\SOFTWARE\CnPack\CnWizards\Active] “CnAlignSizeWizard”="1" “CnEditorWizard”="1" “CnMessageBoxWizard”="1" “CnComponentSelector”="1" “CnTabOrderWizard”="0" “CnBookmarkWizard”="1" “CnSrcTemplate”="0" “CnMsdnWizard”="1" “CnPas2HtmlWizard”="0" “CnReplaceWizard”="0" “CnSourceDiffWizard”="0" “CnStatWizard”="0" “CnPrefixWizard”="0" “CnCorPropWizard”="1" “CnProjectExtWizard”="0" “CnCommentCropperWizard”="0" “CnRepositoryMenuWizard”="0" “CnExplorerWizard”="0" “CnFilesSnapshotWizard”="0" “CnProcListWizard”="1" “CnUsesCleaner”="1" “CnIdeEnhanceMenuWizard”="1" “CnIdeBRWizard”="0" “CnScriptWizard”="0" “CnCodeFormatterWizard”="0" “CnFormEnhanceWizard”="1" “CnSourceHighlight”="1" “CnSrcEditorEnhance”="1" “CnPaletteEnhanceWizard”="1" “CnInputHelper”="1" “CnVerEnhanceWizard”="1" “CnFeedReaderWizard”="1" “CnIniFilerWizard”="0" “CnMemProfWizard”="0"

I'm confident we will squash this bug this time !! :)

My bet is the parameter causing this is : "CnProjectExtWizard"="0"

Seting the value to 0 or 1 doesn't change anything, problem remains until I remove this parameter completely from the registry

Can you confirm please ?

Thanks a lot

lchris789 avatar Apr 14 '22 08:04 lchris789

OK. I'll check it according to your clue again, thanks.

shanzhashu avatar Apr 14 '22 11:04 shanzhashu

Unfortunately, still can't reproduce it, neither remove "CnProjectExtWizard"="0", nor import your registry settings for active wizards. Seems everything is OK in my workstation.

Could you record a video for the whole bug? I'm afraid we missed some potation part which is important.

shanzhashu avatar Apr 15 '22 02:04 shanzhashu

Could you try our 1084 nightly-build? http://www.cnpack.org/downbuilds.php

It adds an option in CnWizards Setting Dialog(The 3rd Page) to Disable All Icons to Reduce GDI Resources. Could you enable this option and restart Delphi and try again to check whether the bug will show again?

shanzhashu avatar Apr 19 '22 04:04 shanzhashu

Hello Liu Xiao,

I confirm the error disapears when I check the new option !

lchris789 avatar Apr 19 '22 11:04 lchris789

OK. It should be the GDI resource problem. Now can avoid it, but our toolbar seems ugly without icons.

shanzhashu avatar Apr 19 '22 12:04 shanzhashu

Hello Liu Xiao, You were right about the toolbar icons. But why do I only get the error at the end of a compilation with errors ? and not everywhere all the time ? This is maybe a clue ?

Edit : important finding It does only occur if I right click on the project tree and choose "build" ( I always do it like this )

If I press shift+F9 or main menu Project-Build... no problem

strange ... issue linked to icons + project tree handling ?

lchris789 avatar Apr 20 '22 11:04 lchris789

1085 continues to decrease GDI Resources even not in "Disable Icons" mode.

In fact, I tried your right click on the project tree and choose "build" before, and still can not reproduce it.

shanzhashu avatar Apr 22 '22 04:04 shanzhashu

Hi shanzhashu,

I solved my problem. Because you tryed to be helpfull I think you deserve to know my latest findings

The final cause was a conflict with a package from Devart ODAC called "Devart DataSet Manager"

After I added the package $(BDSBIN)\DataSetManager280.bpl into disabled IDE packages in the registry the problem ended.

My best guess here is that they use shared bitmap resources with the same name.

But I don't know exactly what happens technically.

They have a trial version here https://www.devart.com/odac/download.html but we are currently still using version 12.0.1

Again Thank you very much Have a nice day Best regards Chris

PS: this info may help other people who use Devart products with Cnpack

if you look ar the stack trace DataSetManager280.bpl allready showed up. I just did not know it was an optionnal component from devart.

  • I don't know how to mark the topic as solved

lchris789 avatar Oct 03 '22 09:10 lchris789

Hello Liu Xiao,I confirm the error disapears when I check the new option !envoyé : 19 avril 2022 à 06:29de : Liu Xiao @.>à : cnpack/cnwizards @.>cc : lchris789 @.>, Author @.>objet : Re: [cnpack/cnwizards] D11 Alexandria and 1.2.1.1066 canvas does not allow to draw on error (Issue #156) Could you try our 1084 nightly-build? http://www.cnpack.org/downbuilds.phpIt adds an option in CnWizards Setting Dialog(The 3rd Page) to Disable All Icons to Reduce GDI Resources. Could you enable this option and restart Delphi and try again to check whether the bug will show again?—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

lchris789 avatar Oct 11 '22 08:10 lchris789

OK. I close this issue. Thanks for your help!

shanzhashu avatar Oct 11 '22 09:10 shanzhashu