473,385 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 12491
weaknessforcats
9,208 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,208 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

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

Similar topics

1
by: toufik toufik | last post by:
I'm using the errorHandler function (http://www.zend.com/zend/spotlight/error.php) to manage error handling in my code, the problem is that in all the tests that I did the error type is always...
2
by: Iona | last post by:
Does anyone know this type of error means? Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) Could not use ''(unknown)''; file already in use. /asp/PPLMain/memberpage.asp, line...
1
by: Iona | last post by:
Thanks for the reply it helped me but then I get this Error Type: Provider (0x80004005) Unspecified error /asp/PPLMain/memberpage.asp, line 10 and my line 10 is still ...
0
by: ITALstudio s.r.l. | last post by:
Hy, In my application I create instances of windows forms into different AppDomain. If I repeat 5 times the following sequence: - Creating AppDomain; - Creating instance of windows form...
6
by: Water Cooler v2 | last post by:
What're the members of the error class/object? Is there a complete reference to all JavaScript objects available on the Web?
5
by: crystalattice | last post by:
I've finally figured out the basics of OOP; I've created a basic character creation class for my game and it works reasonably well. Now that I'm trying to build a subclass that has methods to...
0
by: DKn | last post by:
Hi , I am having a .Net Activex control. I have done coding for COMRegistering and Unregistereing in C#.Net. The code is follows.. static void ComRegister(Type t) { ...
6
by: Myxamatosis | last post by:
Upon compiling my code for a fraction class, the error that i get is a good 50 or so repetitions of error: Class "Fraction" has no member named "Numer" and error: Class "Fraction" has no member...
2
by: colesslow | last post by:
i have these asp files to edit a record in my sql server..but it can't be done. the error is Error Type: ADODB.Recordset (0x800A0E7D) The connection cannot be used to perform this operation. It...
1
by: shivasusan | last post by:
Hi Friends! Please Help me! How i can solve this error? Please explain me, what is the error and how to solve? Error Type: ADODB.Recordset (0x800A0E7D) The connection cannot be used to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.