Click here to Skip to main content
16,005,169 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to retrieve complete network path Pin
Ivano5-May-03 4:55
Ivano5-May-03 4:55 
AnswerRe: How to retrieve complete network path Pin
David Crow5-May-03 5:04
David Crow5-May-03 5:04 
GeneralRe: How to retrieve complete network path Pin
Ivano5-May-03 5:10
Ivano5-May-03 5:10 
GeneralRe: How to retrieve complete network path Pin
David Crow5-May-03 5:14
David Crow5-May-03 5:14 
GeneralExecution problem with TrackPopupMenu, help !!! Pin
flybird5-May-03 4:53
flybird5-May-03 4:53 
GeneralRe: Execution problem with TrackPopupMenu, help !!! Pin
David Crow5-May-03 5:06
David Crow5-May-03 5:06 
GeneralRe: Execution problem with TrackPopupMenu, help !!! Pin
Hari Krishnan (Noida)5-May-03 21:45
Hari Krishnan (Noida)5-May-03 21:45 
General(Stupid?) vector problem Pin
david2625-May-03 4:35
david2625-May-03 4:35 
Hi everyone.

I'm using the following class:

class Objekt
{
public:

CString get_name();
Objekt(const Objekt & temp);
Objekt();
Objekt(CString name);
virtual ~Objekt();

void add_obj_eventout(CString name, CString typ, CString objekt);
void add_obj_eventin(CString name, CString typ, CString objekt);

std::vector<EventIn> m_obj_eventinVector;

//EventIn/Out are some other classes with just 3 CString values

std::vector<EventOut> m_obj_eventoutVector;


private:

CString m_name;
};

Now there is another vector "std::vector<Objekt> m_objektVector;" that should build an "array" of Objekts. That vector is created in a MFC Dialog class (Instance: m_selekt);
What i'm trying to do now, is to access the m_objektVector from another (the first) MFC Dialog class that calls m_selekt via DoModal.

code:
//there have been added some objekts to m_objektVector
if(m_selekt.DoModal() == IDOK)
{

int x = m_selekt.m_objektVector.size();
for(int lv1=0;lv1<x;lv1++)

{
Objekt temp;
temp = m_selekt.m_objektVector[lv1];
CString soll = temp.get_name(); //works great

if(soll == auswahl) //not important
{

int eventins = temp.m_obj_eventinVector.size();
int eventouts = temp.m_obj_eventoutVector.size();
//Here is the problem eventins/outs stays 0 although there are entries for every Objekt!
/*........*/

Why can i get the correct value when calling get_name but trying to get something from the vectors is impossible?
Is it forbidden to create "multi vectors" or are all entries deleted when i'm creating the temp Objekt?
Maybe there is another possibility to send the data from one dlg to another?
Or is it just some stupid mistake (i'm quite new to visual c++)?

I hope you can understand the problem from my description. I'm trying to figure that out for two days now (tried CArray first - what was a complete desaster).

Thanks in advance for any answers/tips!!!

mfg david
GeneralRe: (Stupid?) vector problem Pin
markkuk5-May-03 4:48
markkuk5-May-03 4:48 
Generalsend message from subclass to parent Pin
JensB5-May-03 3:36
JensB5-May-03 3:36 
GeneralRe: send message from subclass to parent Pin
Bartosz Bien5-May-03 3:49
Bartosz Bien5-May-03 3:49 
GeneralRe: send message from subclass to parent Pin
JensB5-May-03 4:02
JensB5-May-03 4:02 
GeneralRe: send message from subclass to parent Pin
Bartosz Bien5-May-03 4:13
Bartosz Bien5-May-03 4:13 
GeneralRe: send message from subclass to parent Pin
JensB5-May-03 4:33
JensB5-May-03 4:33 
GeneralRe: send message from subclass to parent Pin
Renjith Ramachandran5-May-03 4:29
Renjith Ramachandran5-May-03 4:29 
GeneralRe: send message from subclass to parent Pin
JensB5-May-03 20:03
JensB5-May-03 20:03 
GeneralHiding Application Pin
Member 2266405-May-03 3:22
Member 2266405-May-03 3:22 
GeneralRe: Hiding Application Pin
Joaquín M López Muñoz5-May-03 3:25
Joaquín M López Muñoz5-May-03 3:25 
GeneralRe: Hiding Application Pin
Member 2266405-May-03 3:58
Member 2266405-May-03 3:58 
GeneralRe: Hiding Application Pin
jmkhael5-May-03 4:20
jmkhael5-May-03 4:20 
GeneralRe: Hiding Application Pin
David Crow5-May-03 4:14
David Crow5-May-03 4:14 
GeneralRe: Hiding Application Pin
Joseph Dempsey5-May-03 6:09
Joseph Dempsey5-May-03 6:09 
GeneralRe: Hiding Application Pin
David Crow5-May-03 6:54
David Crow5-May-03 6:54 
GeneralRe: Hiding Application Pin
Baris Kurtlutepe5-May-03 13:00
Baris Kurtlutepe5-May-03 13:00 
GeneralRe: Hiding Application Pin
jmkhael5-May-03 6:21
jmkhael5-May-03 6:21 

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.