Board logo

Subject: Refactoring bug, CNPack v. Ver: 0.9.9.625_Unstable Build 2011.12.24 [Print This Page]

Author: forum1    Time: 2012-2-26 03:57     Subject: Refactoring bug, CNPack v. Ver: 0.9.9.625_Unstable Build 2011.12.24

Make unit1 with new class name TObject.
Make public variable MyPublicStringVar : WideString; into class TObject.


Make one Form -> for example Form1.
Write this code in onButtonClick()

[Copy to clipboard]
CODE:
With TObject.Create do begin















   MyPublicStringVar := '0000';   















end;

Now place mouse cursor to variable "MyPublicStringVar " and press key "Ctrl+Shift+E"

Appear error on XE2, update 3

"Object reference not set to an instance of an object"

Detail error

[20155124]{refactoride160.bpl} RefactorCmds.UpdateRefactoringAction (Line 268, "RefactorCmds.pas" + 9) + $9
[500432F4]{rtl160.bpl  } System.@CheckAutoResult (Line 30183, "System.pas" + 4) + $6
[20155124]{refactoride160.bpl} RefactorCmds.UpdateRefactoringAction (Line 268, "RefactorCmds.pas" + 9) + $9
[5003C885]{rtl160.bpl  } System.@AsClass (Line 13357, "System.pas" + 2) + $8
[20156834]{refactoride160.bpl} RefactorCmds.TDelphiRefactorMenuItem.Update (Line 664, "RefactorCmds.pas" + 2) + $12
[500B5357]{rtl160.bpl  } System.Classes.TBasicAction.SetOnExecute (Line 13391, "System.Classes.pas" + 0) + $7
[5031B758]{vcl160.bpl  } Vcl.ActnList.TContainedAction.Update (Line 463, "Vcl.ActnList.pas" + 8) + $28
[500B5245]{rtl160.bpl  } System.Classes.TBasicAction.Create (Line 13331, "System.Classes.pas" + 0) + $D
[50437393]{vcl160.bpl  } Vcl.Menus.TMenuItem.InitiateAction (Line 2459, "Vcl.Menus.pas" + 0) + $B
[50437765]{vcl160.bpl  } Vcl.Menus.TMenuItem.InitiateActions (Line 2615, "Vcl.Menus.pas" + 2) + $B
[50439072]{vcl160.bpl  } Vcl.Menus.DoClick (Line 3689, "Vcl.Menus.pas" + 40) + $E
[50438FB5]{vcl160.bpl  } Vcl.Menus.DoClick (Line 3653, "Vcl.Menus.pas" + 4) + $A
[50439167]{vcl160.bpl  } Vcl.Menus.TMenu.IsShortCut (Line 3743, "Vcl.Menus.pas" + 38) + $6
[50339620]{vcl160.bpl  } Vcl.Controls.TWinControl.IsMenuKey (Line 11609, "Vcl.Controls.pas" + 8) + $12
[50339695]{vcl160.bpl  } Vcl.Controls.TWinControl.CNKeyDown (Line 11629, "Vcl.Controls.pas" + 5) + $4
[2076E36D]{coreide160.bpl} EditorControl.TCustomEditControl.CNKeyDown (Line 2049, "EditorControl.pas" + 16) + $5
[5033280D]{vcl160.bpl  } Vcl.Controls.TControl.WndProc (Line 7204, "Vcl.Controls.pas" + 91) + $6
[20FB0A92]{designide160.bpl} DeskUtil.SetFocusHook (Line 462, "DeskUtil.pas" + 4) + $C
[5033715B]{vcl160.bpl  } Vcl.Controls.TWinControl.WndProc (Line 9976, "Vcl.Controls.pas" + 152) + $6
[2173428F]{vclactnband160.bpl} Vcl.ActnMenus.CallWindowHook (Line 747, "Vcl.ActnMenus.pas" + 20) + $F
[503367B0]{vcl160.bpl  } Vcl.Controls.TWinControl.MainWndProc (Line 9689, "Vcl.Controls.pas" + 3) + $6
[500B6030]{rtl160.bpl  } System.Classes.MakeObjectInstance (Line 13921, "System.Classes.pas" + 0) + $0
[5045231C]{vcl160.bpl  } Vcl.Forms.TApplication.IsKeyMsg (Line 10072, "Vcl.Forms.pas" + 25) + $12
[504523B6]{vcl160.bpl  } Vcl.Forms.TApplication.IsHintMsg (Line 10093, "Vcl.Forms.pas" + 3) + $2
[504525C3]{vcl160.bpl  } Vcl.Forms.TApplication.ProcessMessage (Line 10158, "Vcl.Forms.pas" + 17) + $31
[5045262A]{vcl160.bpl  } Vcl.Forms.TApplication.HandleMessage (Line 10194, "Vcl.Forms.pas" + 1) + $4
[5045295D]{vcl160.bpl  } Vcl.Forms.TApplication.Run (Line 10331, "Vcl.Forms.pas" + 26) + $3



Sorry, I install new version and this is fixed ;)

For refactoring you must use this key => Ctrl + R + R

[ Last edited by  forum1 at 2012-2-26 04:40 ]
Author: Passion    Time: 2012-2-26 09:13

Can't see CnWizards DLL in call stack. weird.




Welcome to CnPack Forum (http://bbs.cnpack.org/) Powered by Discuz! 5.0.0