How to inherit from the Grids class in Delphi 7? -


here's class inherit tstringgrid class. want create grid populated data database. simple class stub:

unit clstcustomstringgrid;  interface      uses grids, dialogs;      type         tcustomstringgrid = class (tstringgrid)             public                 procedure sayhello ();         end;  implementation      procedure tcustomstringgrid.sayhello ();     begin         showmessage('hello world!');         // procedure body     end;  end. 

this have in main form:

uses ...      ...     tcustomstringgrid; // here compilation stops      ...     ...     ...      procedure tmyform.formshow (sender: tobject);     var         mysg: tcustomstringgrid;     begin         mysg := tcustomstringgrid.create(self);         mysg.left := 100;         mysg.top := 40;         mysg.parent := self;         mysg.sayhello();     end; 

the error get:

file not found: 'tcustomstringgrid.dcu' 

please, me figure out doing wrong.

your class declared in unit clstcustomstringgrid;, uses clause using tcustomstringgrid (which class name).

change uses clause:

uses ...   ...   clscustomstringgrid;    ... 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -