Discussion:
Adding a TStringGrid instance to my program
(too old to reply)
Ron Hiler
2008-07-16 18:01:47 UTC
Permalink
Hello all,

Probably a dumb question, but I can't find the answer anywhere I look.

I would like to use the TStringGrid class in my program (using Builder
2007 Professional). However, the help files don't seem to be very
helpful :) I don't typically use VCL components (I tend to prefer to
code vanilla Win32 code), but this particular component seems to be
exactly what I need, so rather than reinvent the wheel, I want to use
what is already available.

I put this line into my class

TStringGrid VialGrid;

As expected, the compiler complained (since I haven't yet added the
appropriate header and library files). So what lib/include files do I
need to add to be able to access TStringGrid?

I tried adding

#include <vcl.h>

but then got a host of errors. I just want this ONE component, is
there any easy way to add it in without adding the entire VCL?
keith
2008-08-08 12:48:15 UTC
Permalink
Post by Ron Hiler
Hello all,
Probably a dumb question, but I can't find the answer anywhere I look.
I would like to use the TStringGrid class in my program (using Builder
2007 Professional). However, the help files don't seem to be very
helpful :) I don't typically use VCL components (I tend to prefer to
code vanilla Win32 code), but this particular component seems to be
exactly what I need, so rather than reinvent the wheel, I want to use
what is already available.
I put this line into my class
TStringGrid VialGrid;
As expected, the compiler complained (since I haven't yet added the
appropriate header and library files). So what lib/include files do I
need to add to be able to access TStringGrid?
I tried adding
#include <vcl.h>
but then got a host of errors. I just want this ONE component, is
there any easy way to add it in without adding the entire VCL?
Don't think so. The TStringGrid is derived from TObject, which is
pretty much the core of the vcl. Also, these objects need to be
created at runtime, so the line should read TStringGrid *VialGrid; and
you'll use the new operator to instantiate the object.

Loading...