473,387 Members | 1,515 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,387 software developers and data experts.

Left side of '->' requires a pointer to class; type found was Structure

Dear Friends

I have been getting the following error
Error 185: "WorkFlow_dce.cpp", line 58 # Left side of '->' requires a
pointer to class; type found was 'struct WF_SEARCH_WU'.
lclStruct->wfWuHandle.workunitId =(long) feStruct->wfWuHandle-
>workunitId;
^^^^^^^^
Error 185: "WorkFlow_dce.cpp", line 59 # Left side of '->' requires a
pointer to class; type found was 'struct WF_SEARCH_WU'.
lclStruct->wfWuHandle.workunitSeq = (int)feStruct-
>wfWuHandle->workunitSeq;
^^^^^^^^
Error 185: "WorkFlow_dce.cpp", line 60 # Left side of '->' requires a
pointer to class; type found was 'struct WF_SEARCH_WU'.
lclStruct->wfWuHandle.updateSerialNum = (int)feStruct-
>wfWuHandle->updateSerialNum;
^^^^^^^^
Error 185: "WorkFlow_dce.cpp", line 61 # Left side of '->' requires a
pointer to class; type found was 'struct WF_SEARCH_WU'.
strcpy((char*)lclStruct->prodType,(char*)feStruct-
>prodType.c_str());
^^^^^^^^
Error 185: "WorkFlow_dce.cpp", line 62 # Left side of '->' requires a
pointer to class; type found was 'struct WF_SEARCH_WU'.
strcpy((char*)lclStruct->prodSubType,(char*)feStruct-
>prodSubType.c_str());
^^^^^^^^
Error 185: "WorkFlow_dce.cpp", line 63 # Left side of '->' requires a
pointer to class; type found was 'struct WF_SEARCH_WU'.
strcpy((char*)lclStruct->opnType,(char*)feStruct-
>opnType.c_str());
^^^^^^^^
Error 185: "WorkFlow_dce.cpp", line 64 # Left side of '->' requires a
pointer to class; type found was 'struct WF_SEARCH_WU'.
strcpy((char*)lclStruct->customerNum,(char*)feStruct-
>customerNum.c_str());
^^^^^^^^

In my WorkFlow_dce.cpp file
In funtion definition of fillWfSearchStructure I have
void fillWfSearchStructure(WF_SEARCH_WU *lclStruct ,WfSearchWu
&feStruct)
{
lclStruct->wfWuHandle.workunitId =(long) feStruct->wfWuHandle-
>workunitId;
lclStruct->wfWuHandle.workunitSeq = (int)feStruct->wfWuHandle-
>workunitSeq;
lclStruct->wfWuHandle.updateSerialNum = (int)feStruct->wfWuHandle-
>updateSerialNum;
strcpy((char*)lclStruct->prodType,(char*)feStruct->prodType.c_str());
strcpy((char*)lclStruct->prodSubType,(char*)feStruct-
>prodSubType.c_str());
strcpy((char*)lclStruct->opnType,(char*)feStruct->opnType.c_str());
strcpy((char*)lclStruct->customerNum,(char*)feStruct-
>customerNum.c_str());
}

---------------------------------------------------------------------------------------------------------------------------------------
in WorkFlow_dce.h

The declaration of structure WF_SEARCH_WU
is

typedef struct
{
WF_WU_HANDLE wfWuHandle; // workunit handle structure
char prodType[4]; // [4]
char prodSubType[4]; // [4]
char opnType[7]; // [7]
char customerNum[11]; // [11]
}WF_SEARCH_WU;

Also the function declaration in the same file is as below
typedef WF_SEARCH_WU WfSearchWu;
void fillWfSearchStructure( WF_SEARCH_WU *lclStruct ,WfSearchWu
&feStruct );

Why would I get the above errors

Can someone please guide me in the right direction

Thanks
Amit

Feb 1 '07 #1
5 3150

Amit_Basnak napsal:
Dear Friends

I have been getting the following error
Error 185: "WorkFlow_dce.cpp", line 58 # Left side of '->' requires a
pointer to class; type found was 'struct WF_SEARCH_WU'.
lclStruct->wfWuHandle.workunitId =(long) feStruct->wfWuHandle-
workunitId;
---------------------------------------------------------------------------------------------------------------------------------------
in WorkFlow_dce.h

The declaration of structure WF_SEARCH_WU
is

typedef struct
{
WF_WU_HANDLE wfWuHandle; // workunit handle structure
char prodType[4]; // [4]
char prodSubType[4]; // [4]
char opnType[7]; // [7]
char customerNum[11]; // [11]
}WF_SEARCH_WU;

Also the function declaration in the same file is as below
typedef WF_SEARCH_WU WfSearchWu;
void fillWfSearchStructure( WF_SEARCH_WU *lclStruct ,WfSearchWu
&feStruct );

Why would I get the above errors

Can someone please guide me in the right direction

Thanks
Amit
You can access members of struct with operator . (DOT) if you have
instance of this struct. You can use operator -if you have pointer
to instance of struct or if you have defined overloaded operator-for
this structure.

Feb 1 '07 #2
On Feb 1, 4:13 pm, "Amit_Basnak" <Amit.Bas...@gmail.comwrote:
Dear Friends

I have been getting the following error
Error 185: "WorkFlow_dce.cpp", line 58 # Left side of '->' requires a
pointer to class; type found was 'struct WF_SEARCH_WU'.
lclStruct->wfWuHandle.workunitId =(long) feStruct->wfWuHandle-
The error is quite clear, you are trying to use something as if it
were a pointer while it's not.
In my WorkFlow_dce.cpp file
In funtion definition of fillWfSearchStructure I have
void fillWfSearchStructure(WF_SEARCH_WU *lclStruct ,WfSearchWu
&feStruct)
I'm not sure, the error-message got line-wrapped so it's hard to tell
what it's pointing to but it seems to me like the parameter feStruct
is passed as a WfSearchWu-reference but you are trying to use it as if
it were a WfSearchWu-pointer. Either change the type of the parameter
of replace the '->' with a '.'.

--
Erik Wikström

Feb 1 '07 #3
Amit_Basnak wrote:
>
typedef WF_SEARCH_WU WfSearchWu;

void fillWfSearchStructure(
WF_SEARCH_WU *lclStruct ,
WfSearchWu &feStruct
)
{
lclStruct->wfWuHandle.workunitId =
(long) feStruct->wfWuHandle->workunitId;
"feStruct" you have declared as reference "WfSearchWu& feStruct", not
as pointer, and class WfSearchWu has no overloaded "operator->". Write
operator point "." instead of "->"
lclStruct->wfWuHandle.workunitId =
(long) feStruct.wfWuHandle->workunitId;
--
Maksim A Polyanin
Feb 1 '07 #4
Amit_Basnak wrote:
I have been getting the following error
Error 185: "WorkFlow_dce.cpp", line 58 # Left side of '->' requires a
pointer to class; type found was 'struct WF_SEARCH_WU'.
lclStruct->wfWuHandle.workunitId =(long) feStruct->wfWuHandle-
>workunitId;

[..]

In my WorkFlow_dce.cpp file
In funtion definition of fillWfSearchStructure I have
void fillWfSearchStructure(WF_SEARCH_WU *lclStruct ,WfSearchWu
&feStruct)
{
lclStruct->wfWuHandle.workunitId =(long) feStruct->wfWuHandle-
>workunitId;
Since 'feStruct' is a _reference_ to a 'WfSearchWu' objects, you must
use '.' to access its members.
[..]
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Feb 1 '07 #5
On Feb 1, 8:30 pm, "Victor Bazarov" <v.Abaza...@comAcast.netwrote:
Amit_Basnak wrote:
I have been getting the following error
Error 185: "WorkFlow_dce.cpp", line 58 # Left side of '->' requires a
pointer to class; type found was 'struct WF_SEARCH_WU'.
lclStruct->wfWuHandle.workunitId =(long) feStruct->wfWuHandle-
workunitId;
[..]
In my WorkFlow_dce.cpp file
In funtion definition of fillWfSearchStructure I have
void fillWfSearchStructure(WF_SEARCH_WU *lclStruct ,WfSearchWu
&feStruct)
{
lclStruct->wfWuHandle.workunitId =(long) feStruct->wfWuHandle-
workunitId;

Since 'feStruct' is a _reference_ to a 'WfSearchWu' objects, you must
use '.' to access its members.
[..]

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask- Hide quoted text -

- Show quoted text -
Thank you all for pointing out the cause of the error . The Error got
resolved with the desired changes.
Thank you all foryour help and time devoted to this.
Amit

Feb 2 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Raymond H. | last post by:
Hello, in my vb projet, I put a WebBrowser and when I view the contents of my hard disk with 'WebBrowser1.Navigate "C:\"' I view my directory in the right side only and in the left side it is'nt...
1
by: Paul Bramscher | last post by:
Here's one for pathological SQL programmers. I've got a table of things called elements. They're components, sort of like amino acids, which come together to form complex web pages -- as nodes...
3
by: Doug McCrae | last post by:
http://www.btinternet.com/~doug.mccrae/go4learning/index.html As it says in the subject, a two column layout (plus header and footer boxes). I feel the left column really needs to be fixed width...
7
by: Alex | last post by:
Hi Everone, I need some advice on how to setup 4 columns where the outside two are absolute (120px) and the inner two (side by side) are relevent (Fluid) and change with the screen. Here's my...
17
by: orekinbck | last post by:
Hi There Say I want to check if object1.Property1 is equal to a value, but object1 could be null. At the moment I have code like this: if (object1 != null) { if (object1.Property ==...
4
by: UJ | last post by:
I have a long list of items that the user will be able to select from. When they select an item, I'd like to have more detailed information appear on the right side of the screen. I've already got...
5
by: john_aspinall | last post by:
http://www.ainewmedia.co.uk/test.htm Im learning CSS based layout and Im pulling my hair out as to why wont my banner DIV float to the right of my login box? It works fine in IE. Any help...
8
by: Doron Farber | last post by:
Hi All, How can I Move the Server explorer window to the left. When ever I double click on the Server explorer top window it goes to the bottom of the IDE. Thanks, Doron
4
by: =?Utf-8?B?UmljaA==?= | last post by:
Hello, Is there a setting/property for displaying a checkbox label (or radiobutton label) on the left hand side instead of the right hand side? Or am I limited to no text in the label - take on...
4
by: moondaddy | last post by:
I have a wpf project where I use a canvas to drag shapes around. when I drag a shape beyond the right or bottom side I get scrollbars which is good. I also get scrollbars when I zoom in and a...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.