 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Hugh W Stewart Guest
|
Posted: Mon Aug 16, 2004 12:02 am Post subject: Not an allowed type |
|
|
I want the two components shown partially below to have a pointer to the
other. For some reason, I keep getting "Not an allowed type". Why?
Thanks for your help.
Hugh Stewart
tmCalendar.h
<snip>
#include "tmClockControl.h"
class TtmClockControl;
class PACKAGE TtmCalendar : public TWinControl
{
private:
<snip>
TtmClockControl* FClockCtrl;
protected:
void __fastcall CreateWnd();
public:
__fastcall TtmCalendar(TComponent* Owner);
<snip>
__published:
__property TtmClockControl* ClockCtrl = {read=FClockCtrl,
write=FClockCtrl}; // Not an allowed type
};
//---------------------------------------------------------------------------
tmClockControl.h
#include "tmCalendar.h"
//---------------------------------------------------------------------------
class TtmCalendar;
class PACKAGE TtmClockControl : public TPanel
{
private:
<snip>
TtmCalendar* FCalendar;
<snip>
protected:
void __fastcall CreateWnd();
public:
<snip>
__fastcall TtmClockControl(TComponent* Owner);
__published:
__property TtmCalendar Calendar* = {write=FCalendar, read=FCalendar};
// Not an allowed type
};
//----------------------------------------------------------------------------
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Aug 16, 2004 1:04 am Post subject: Re: Not an allowed type |
|
|
"Hugh W Stewart" <hughstew (AT) bellatlantic (DOT) net> wrote
| Quote: | __property TtmCalendar Calendar* = {write=FCalendar, read=FCalendar};
|
You have the asterik in the wrong place. It should be this instead:
__property TtmCalendar* Calendar = {write=FCalendar, read=FCalendar};
Gambit
|
|
| Back to top |
|
 |
Hugh W Stewart Guest
|
Posted: Mon Aug 16, 2004 1:43 am Post subject: Re: Not an allowed type |
|
|
"Hugh W Stewart" <hughstew (AT) bellatlantic (DOT) net> wrote
| Quote: | __property TtmCalendar Calendar* = {write=FCalendar, read=FCalendar};
|
You have the asterik in the wrong place. It should be this instead:
__property TtmCalendar* Calendar = {write=FCalendar, read=FCalendar};
Gambit
Hi, Remy,
That was foolish of me, one of the problems of working alone is you have
no-one to look over your code. But fixing it didn't solve the problem.
I'm listing the entire header files, in case there's something sneaky in
there.
After the two Not an allowed type errors, I get an internal compiler
error from another module.
Thank you so much just for being there!
Hugh
tmClockControl.h
#ifndef tmClockControlH
#define tmClockControlH
#include <SysUtils.hpp>
#include <Classes.hpp>
#include <Controls.hpp>
#include <ExtCtrls.hpp>
#include "DateTimeEdit.hpp"
#include "..\GeoTimeLine.h"
#include "tmClock.h"
#include "tmCalendar.h"
//---------------------------------------------------------------------------
class TtmCalendar;
class TtmClock;
class PACKAGE TtmClockControl : public TPanel
{
private:
TtmDateTimeEdit* tmDateTimeEdit;
TTrackBar* TrackBar;
TStaticText* Text;
TYMDHMS* FYMDHMS;
TtmCalendar* FCalendar;
TtmClock* FClock;
bool Inhibit;
void __fastcall SetDateTime(DATETIME ADateTime);
void __fastcall SetYMDHMS(TYMDHMS* AYMDHMS);
void __fastcall TrackBarChange(TObject* Sender);
void __fastcall YMDHMSChange(System::TObject* Sender, TDateElement
Element,
Word &Era, int &Year, int &Month, int &Day, int &DOW,
int &Hour, int &Minute, int &Second, bool
&AllowChange, int UD);
protected:
void __fastcall CreateWnd();
public:
__property TYMDHMS* YMDHMS = {write=SetYMDHMS};
__fastcall TtmClockControl(TComponent* Owner);
__published:
__property DATETIME DateTime = {write=SetDateTime};
__property TtmClock* Clock = {write=FClock, read=FClock}; Not an
allowed type
};
//----------------------------------------------------------------------------
#endif
tmClock.h
#ifndef tmClockH
#define tmClockH
#include <SysUtils.hpp>
#include <Classes.hpp>
#include <MMSystem.h>
#include "tmClockControl.h"
#include "tmCalendar.h"
#include "..\GeoTimeLine.h"
//---------------------------------------------------------------------------
class TtmCalendar;
class TtmClockControl;
class PACKAGE TtmClock : public TWinControl
{
private:
DATETIME FRate;
DATETIME FDateTime;
DATETIME HoldDateTime;
DATETIME StepDateTime;
MMRESULT timerID;
bool FRun;
bool FInhibit;
TtmClockControl* FControl;
TtmCalendar* FCalendar;
void __fastcall SetRate(DATETIME ARate);
void __fastcall SetRun(bool ARun);
void __fastcall SetDateTime(Extended ADateTime);
void __fastcall TimerHit(TMessage& Msg);
protected:
void __fastcall CreateWnd();
void __fastcall BeforeDestruction();
public:
__property bool Run = {read=FRun, write=SetRun};
__property bool Inhibit = {read=FInhibit, write=FInhibit};
__property DATETIME DateTime = {read=FDateTime, write=SetDateTime};
__property DATETIME Rate = {read=FRate, write=SetRate};
__fastcall TtmClock(TComponent* Owner);
__published:
__property TtmClockControl* Control = {read=FControl,
write=FControl}; Not an allowed type
__property TtmCalendar* Calendar = {read=FCalendar, write=FCalendar};
// message map
BEGIN_MESSAGE_MAP
VCL_MESSAGE_HANDLER(CM_CLOCKHIT, TMessage, TimerHit)
END_MESSAGE_MAP(TWinControl)
};
//---------------------------------------------------------------------------
#endif
|
|
| Back to top |
|
 |
Todd Brylski Guest
|
Posted: Mon Aug 16, 2004 4:14 am Post subject: Re: Not an allowed type |
|
|
"Hugh W Stewart" <hughstew (AT) bellatlantic (DOT) net>
wrote in message news:4120113a$1 (AT) newsgroups (DOT) borland.com...
| Quote: | class TtmCalendar;
class TtmClock;
class TtmCalendar;
class TtmClockControl;
|
When forward declaring VCL classes (anything descending from TObject)
use the DELPHICLASS modifier:
class DELPHICLASS TtmCalendar;
class DELPHICLASS TtmClock;
class DELPHICLASS TtmCalendar;
class DELPHICLASS TtmClockControl;
Todd
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|