Re:Why?
"Gonzalo Nieva" <
XXXX@XXXXX.COM >wrote:
Quote
Why can I use a data module in a plain unit file? I used an
include to access the querys inside the module, but the
compiler can see them.
I assume that you ment that the compiler can NOT see them. If
you want to access members or methods of an other unit, in the
header where the members to be accessed are declared, you need
to make them public:
//-------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TButton *Button1;
void __fastcall Button1Click(TObject *Sender);
private: // User declarations
// Everything in this section is private to the unit
public: // User declarations
// Everything in this section is public
// to access MyQuerry from another unit include this
// header in that unit and use Form1->MyQuerry();
void __fastcall MyQuerry();
__fastcall TForm1(TComponent* Owner);
};
//-------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//-------------------------------------------------------------
~ JD