468,496 Members | 1,802 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,496 developers. It's quick & easy.

error C2227: left of '->ChassisID' must point to class/struct/union/generic type

for(i=0 ; i<listNum ; i++) {
checker.checkN1DisagreementSwitch(pRep_Active_SLis t[i].ChassisID, pRep_Active_SList[i].SlotID,
pRep_Standby_SList[i].ChassisID, pRep_Standby_SList[i].SlotID);
}
hi, i m getting the error "error C2227: left of '->ChassisID' must point to class/struct/union/generic type", when i try to compile the above code in my project.

The object(pRep_Active_SList) which is accessing the structure member variable(ChassisID) is a pointer object of that structure.

so, instead of ' . ' i used ' -> ' to access the structure variable. but again it shows the same error.
can any one help to solve it....

regard,
raja
Jan 29 '08 #1
3 12029
weaknessforcats
9,207 Expert Mod 8TB
pRep_Active_SLis t[i].ChassisID
Are you saying that ChassisID is a public member variable, like in a struct??

You may need t post the code that creates pRep_Active_SLis t[i] and the class/struct declaration of Rep_Active_SList.
Jan 29 '08 #2
Are you saying that ChassisID is a public member variable, like in a struct??

You may need t post the code that creates pRep_Active_SLis t[i] and the class/struct declaration of Rep_Active_SList.

hi.. good morning... thanks for reply me,

ya..ChassisID is a public member variable of the structure BSMChassisSlotList_t. The declaration of ChassisID is as follows

typedef struct _BSMChassisSlotList_t_ {
char ChassisID[BSM_CHASSIS_SIZE];
DWORD SlotID;
} BSMChassisSlotList_t;

pRep_Active_SList is a pointer object of the structure BSMChassisSlotList_t and the declaration is

DWORD NSNetSwitchExchangeEx(BSMChassisSlotList_t *pRep_Active_SList, BSMChassisSlotList_t *pRep_Standby_SList,int listNum)

sorry, i cont send u the whole code since it is 2 kloc code...

the code that create the pRep_Active_SLis t[i] is
for(i=0 ; i<listNum ; i++) {
checker.checkN1DisagreementSwitch(pRep_Active_SLis t[i].ChassisID, pRep_Active_SList[i].SlotID,
pRep_Standby_SList[i].ChassisID, pRep_Standby_SList[i].SlotID);
}

waiting for ur reply...

regards,
raja
Jan 30 '08 #3
weaknessforcats
9,207 Expert Mod 8TB
There's a lotta code missing. But I fudged in some dummy code and made a global array and got things to compile (but not link - i leave that to you.
Expand|Select|Wrap|Line Numbers
  1. #define BSM_CHASSIS_SIZE 1024
  2. typedef struct _BSMChassisSlotList_t_ {
  3. char ChassisID[BSM_CHASSIS_SIZE];
  4. DWORD SlotID;
  5. } BSMChassisSlotList_t;
  6.  
  7. class DUMMY
  8. {
  9.     public: 
  10.         void checkN1DisagreementSwitch(char* FirstID, DWORD FirstSlotID,
  11. char* SecondChassisID, DWORD SecondSlotID);
  12. };
  13. void checkN1DisagreementSwitch(char* FirstID, DWORD FirstSlotID,
  14. char* SecondChassisID, DWORD SecondSlotID)
  15. {
  16.  
  17. }
  18. BSMChassisSlotList_t pRep_Active_SList[1024];
  19.  
  20. DWORD NSNetSwitchExchangeEx(BSMChassisSlotList_t *pRep_Active_SList, BSMChassisSlotList_t *pRep_Standby_SList,int listNum)
  21. {
  22.     DUMMY checker;
  23.     int i = 0;
  24.     for(i=0 ; i<listNum ; i++) {
  25.     checker.checkN1DisagreementSwitch(pRep_Active_SList[i].ChassisID, pRep_Active_SList[i].SlotID,
  26.     pRep_Standby_SList[i].ChassisID, pRep_Standby_SList[i].SlotID);
  27.     }
  28.     return 0;
  29. }
  30. int main()
  31. {
  32.  
  33. }
  34.  
Be sure your pRep_Active_SList exists ssomewhere as an array.

Also please note that in your original code you had an embedded space. See the ^ in the code below.
checker.checkN1DisagreementSwitch(pRep_Active_SLis t[i].ChassisID,
----------------------------------------------------------------------------^
pRep_Active_SList[i].SlotID,
If that's in your actual code, then you will get an error.
Jan 30 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by toufik toufik | last post: by
2 posts views Thread by Iona | last post: by
1 post views Thread by Iona | last post: by
6 posts views Thread by Water Cooler v2 | last post: by
5 posts views Thread by crystalattice | last post: by
3 posts views Thread by gieforce | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.