ListView:= TListBoxView.Create(@ListBox1);
就是这么一句出的错,ListBox1是form1里的控件,TListBoxView里封装了一个私有域pListBox,Pointer型,用构造方法传进去指向该控件
编译正常,用行时出错,单步跟踪create方法没错,返回后出错,弹出对话框“Project Project2.exe raised exception class EAccessviolation with message 'Access violation at address 00453990 in module
'Project2.exe'. Write of address 0000000C'. Process stopped. Use Step or Run to continue.”高手指教,感激不甚
为什么还要@ListBox1???建议直接传对象TListBoxView.Create(ListBox : Tobject); 调用TListBoxView.Create(ListBox1);