Click here to Skip to main content
15,902,636 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralKilling program execution Pin
esepich30-Sep-03 18:32
esepich30-Sep-03 18:32 
GeneralRe: Killing program execution Pin
keegan30-Sep-03 19:06
keegan30-Sep-03 19:06 
GeneralRe: Killing program execution Pin
Mike Dimmick1-Oct-03 2:12
Mike Dimmick1-Oct-03 2:12 
GeneralRe: Killing program execution Pin
Arjan Schouten1-Oct-03 4:33
Arjan Schouten1-Oct-03 4:33 
GeneralCEdit and Regions Pin
Fozed30-Sep-03 17:48
Fozed30-Sep-03 17:48 
GeneralPassing a vector of pointers Pin
mcoloney30-Sep-03 16:06
mcoloney30-Sep-03 16:06 
GeneralRe: Passing a vector of pointers Pin
Dave Bryant30-Sep-03 16:16
Dave Bryant30-Sep-03 16:16 
GeneralRe: Passing a vector of pointers Pin
mcoloney30-Sep-03 16:38
mcoloney30-Sep-03 16:38 
Dave, thanks again for your quick and informative reply.

Allow me to include better code representation:
My function definition is:
void addPhoneRecord(string& name, string& address, string& phone, PhoneRecord* records[])<br />
{<br />
    Name* nameEntry = new Name();<br />
    nameEntry->set_name(name);<br />
    Address* addressEntry = new Address();<br />
    addressEntry->set_address(address);<br />
    PhoneRecord* phoneEntry = new PhoneRecord(nameEntry, addressEntry);<br />
    phoneEntry->set_phoneNumber(phone);<br />
<br />
    records.push_back(phoneEntry);<br />
}


When I call it from main I'm using:
addPhoneRecord(name, address, phone, &phonerecs.back());

All of the setting functions and the like work like they should, and properly.

The error I'm getting is:
error C2228: left of '.push_back' must have class/struct/union type

If I comment out the records.push_back(phoneEntry); it compiles fine, but I get the standard WinXP error report problem.

Any suggestions?
Thanks again.
GeneralRe: Passing a vector of pointers Pin
Dave Bryant30-Sep-03 16:43
Dave Bryant30-Sep-03 16:43 
GeneralRe: Passing a vector of pointers Pin
mcoloney30-Sep-03 16:51
mcoloney30-Sep-03 16:51 
QuestionWhy do some API calls not work with my windows service? Pin
csurfer7930-Sep-03 15:49
csurfer7930-Sep-03 15:49 
AnswerRe: Why do some API calls not work with my windows service? Pin
Dave Bryant30-Sep-03 16:18
Dave Bryant30-Sep-03 16:18 
AnswerRe: Why do some API calls not work with my windows service? Pin
l a u r e n30-Sep-03 19:46
l a u r e n30-Sep-03 19:46 
QuestionGetting a window's class name? Pin
IGx8930-Sep-03 14:55
IGx8930-Sep-03 14:55 
AnswerRe: Getting a window's class name? Pin
Mike Dimmick1-Oct-03 2:20
Mike Dimmick1-Oct-03 2:20 
Generaloperator != for iterators Pin
mcoloney30-Sep-03 14:49
mcoloney30-Sep-03 14:49 
GeneralRe: operator != for iterators Pin
Dave Bryant30-Sep-03 14:52
Dave Bryant30-Sep-03 14:52 
GeneralRe: operator != for iterators Pin
mcoloney30-Sep-03 14:58
mcoloney30-Sep-03 14:58 
GeneralRe: operator != for iterators Pin
Dave Bryant30-Sep-03 15:02
Dave Bryant30-Sep-03 15:02 
GeneralRe: operator != for iterators Pin
mcoloney30-Sep-03 15:07
mcoloney30-Sep-03 15:07 
GeneralCode to show Sample Unicode Chars Pin
prpub130-Sep-03 14:29
sussprpub130-Sep-03 14:29 
GeneralThe for statement Pin
claytide30-Sep-03 11:50
claytide30-Sep-03 11:50 
GeneralRe: The for statement Pin
Christian Graus30-Sep-03 12:07
protectorChristian Graus30-Sep-03 12:07 
GeneralRe: The for statement Pin
Colin Angus Mackay30-Sep-03 12:36
Colin Angus Mackay30-Sep-03 12:36 
GeneralRe: The for statement Pin
Blake Coverett30-Sep-03 19:16
Blake Coverett30-Sep-03 19:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.