Click here to Skip to main content
15,915,093 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: CRecordset problem Pin
ovidiucucu24-Jun-06 7:16
ovidiucucu24-Jun-06 7:16 
GeneralRe: CRecordset problem Pin
moodsey21124-Jun-06 14:11
moodsey21124-Jun-06 14:11 
GeneralRe: CRecordset problem Pin
ovidiucucu29-Jun-06 2:51
ovidiucucu29-Jun-06 2:51 
Questionsource of viewport [modified] Pin
hoa_nguyen23-Jun-06 15:15
hoa_nguyen23-Jun-06 15:15 
AnswerRe: source of viewport Pin
Hamid_RT23-Jun-06 21:12
Hamid_RT23-Jun-06 21:12 
QuestionHow to measure memory consumption? Pin
nysubmarine23-Jun-06 10:47
nysubmarine23-Jun-06 10:47 
AnswerRe: How to measure memory consumption? Pin
Jun Du23-Jun-06 11:12
Jun Du23-Jun-06 11:12 
QuestionLink errors using std::vector Pin
BuckBrown23-Jun-06 10:22
BuckBrown23-Jun-06 10:22 
Confused | :confused: Hi,

I am using Visual C++ 6.0 MFC and want to store objects into an array. I tried using CArray but once I got the copy contructor so it would not give me compile errors I then got LINK errors. Since so many people on the internet sugested to others trying to use CArray to use std::vector instead I decided to use std::vector, the compiler gives me couple of warnings, but I still get LINK errors.

If I do this:
std::string strData = "One";
std::vector<std::string> strVector;
strVector.push_back(strData);
std::string strData = "Two";
strVector.push_back(strData);

It compiles, links, and executes just fine.

The object that I am trying to store is,
class CInstrument : public CObject
{
public:
CInstrument();
CInstrument(const CInstrument &Instrument);
CInstrument& operator = (const CInstrument);
virtual ~CInstrument();
int m_dGPIBAddress;
}

The .cpp file implementation is:
CInstrument Instrument;
std::vector<cinstrument> Instruments;
Instrument.m_dGPIBAddress = 9;
Instruments.push_back(Instrument); // If I comment this lin out I do not get link errors

Does anyone see whats wrong here? Also, as a side note, Visual Studio has a popup that comes up after the ObjectName'.' so you can select the objects members. The popup does not come up for the Instruments'.' vector. This shouldn't be this difficult as I have already spent 12 hours trying to build an array of objects of class CInstrument.

Thanks,


Buck
AnswerRe: Link errors using std::vector Pin
Neville Franks23-Jun-06 13:27
Neville Franks23-Jun-06 13:27 
QuestionAPI needed Pin
act_x23-Jun-06 9:57
act_x23-Jun-06 9:57 
AnswerRe: API needed Pin
cje23-Jun-06 9:59
cje23-Jun-06 9:59 
AnswerRe: API needed Pin
David Crow23-Jun-06 10:00
David Crow23-Jun-06 10:00 
AnswerRe: API needed Pin
act_x23-Jun-06 10:05
act_x23-Jun-06 10:05 
AnswerRe: API needed Pin
Hamid_RT23-Jun-06 21:08
Hamid_RT23-Jun-06 21:08 
QuestionBinary File IO Pin
Jumpin' Jeff23-Jun-06 9:06
Jumpin' Jeff23-Jun-06 9:06 
AnswerRe: Binary File IO Pin
David Crow23-Jun-06 9:10
David Crow23-Jun-06 9:10 
GeneralRe: Binary File IO Pin
Jumpin' Jeff23-Jun-06 9:41
Jumpin' Jeff23-Jun-06 9:41 
GeneralRe: Binary File IO Pin
David Crow23-Jun-06 9:53
David Crow23-Jun-06 9:53 
GeneralRe: Binary File IO [modified] Pin
Zac Howland23-Jun-06 10:02
Zac Howland23-Jun-06 10:02 
AnswerRe: Binary File IO [modified] Pin
Joe Woodbury23-Jun-06 9:25
professionalJoe Woodbury23-Jun-06 9:25 
GeneralRe: Binary File IO Pin
Jumpin' Jeff23-Jun-06 9:50
Jumpin' Jeff23-Jun-06 9:50 
GeneralRe: Binary File IO Pin
David Crow23-Jun-06 9:55
David Crow23-Jun-06 9:55 
GeneralRe: Binary File IO Pin
Jumpin' Jeff23-Jun-06 9:59
Jumpin' Jeff23-Jun-06 9:59 
GeneralRe: Binary File IO Pin
Joe Woodbury23-Jun-06 10:37
professionalJoe Woodbury23-Jun-06 10:37 
QuestionEntry Points into Exe files Pin
Hibelton23-Jun-06 8:53
Hibelton23-Jun-06 8:53 

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.