This code is already writeen. The variable i ha used for 2D vector is vec.
when i use vec in ONDRAW(). it shows undeclared identifier

I have attached the complete set of codes above in the discussion i had written in ONPLOT() in the contourplotdlg.cpp which is dialog
Please have a look at it..

I did look at it. At this point all I can really say, and I don't mean this in a bad way as everybody starts somewhere, is you're not understanding some very fundamental concepts of OOP and doc/view architecture.

Do you understand classes and their member variables?

June 5th, 2012, 09:19 AM

GCDEF

Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp

Yes it was sucefful... Could u sugeest me..how to acess the vector.. The vector I am not able to acess in ONDRAW().. Please help me..

Again, the vector should be a member of the document class. It should not exist in the dialog class.

June 5th, 2012, 09:23 AM

tarkes

Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp

Quote:

Originally Posted by GCDEF

I did look at it. At this point all I can really say, and I don't mean this in a bad way as everybody starts somewhere, is you're not understanding some very fundamental concepts of OOP and doc/view architecture.

Do you understand classes and their member variables?

yess yess and i do understand that.. It was sucessful what u had suggested..

I need an if condition in ONDRAW() so that when i call invalidate if (invalidate is called) then follwo the plotting instructions;

Now How to acess the vector in ONDRAW()...

Please donot mind. from last 10 days I am struggling.. May be in confusion state i am asking silly questions.. I am in learning stage also and beginner.. Gradually once I pickup and understand it i will be able to do..

June 5th, 2012, 09:24 AM

tarkes

Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp

Quote:

Originally Posted by GCDEF

Again, the vector should be a member of the document class. It should not exist in the dialog class.

yess I was guessing that.. Got some Idea.. i will try that in the night.. Thanks a lot..

June 5th, 2012, 09:39 AM

Igor Vartanov

Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp

Quote:

Originally Posted by tarkes

Soory If i am asking any stupid question.. But I am bit new to the Visual C++ 6.. I am in beginner stage working on it and learnign it..Please Kindly help me

You show us no real project. So we have to answer with something that you have to adopt in your code some way proper for your real code. In case you're not able to do that, you're stuck, no matter how sorry you are about this.

To have a conversation both sides must speak the same language. So, please put aside your current project and try to analyze the sample Victor recommended you, as well as other samples from MSDN site. Play with the samples, modify them and see what effect your changes cause. Buy (or lend from somebody) some books on MFC programming and work those through. When you understand the concept, please come back, you're always welcome.

June 5th, 2012, 02:41 PM

tarkes

Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp

Quote:

Originally Posted by VictorN

What is a pView and where do you call this line from?

Quote:

Originally Posted by Igor Vartanov

You show us no real project. So we have to answer with something that you have to adopt in your code some way proper for your real code. In case you're not able to do that, you're stuck, no matter how sorry you are about this.

To have a conversation both sides must speak the same language. So, please put aside your current project and try to analyze the sample Victor recommended you, as well as other samples from MSDN site. Play with the samples, modify them and see what effect your changes cause. Buy (or lend from somebody) some books on MFC programming and work those through. When you understand the concept, please come back, you're always welcome.

Ok I followed all the instructions as given.. All codes compile successfully without any errror. But during execution it gets stuck.

I found that this statement makes the loop stuck and ends the SDI
pDoc->RGBVector.push_back(temp)

pDoc- is a CContourPlotDoc pointer declared in CONTOURdialog (userdefined) header file inherited from CDialog class
RGBVector- declared in CContourPlotDoc.h file which stores the RGB values in vector
temp is RGB value vector 3*1 and pushed into RGBVector
It is done so that I can access the RGB vector in ONDRAW()

Is there any syntax error. or the methodology is wrong??

June 5th, 2012, 02:45 PM

GCDEF

Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp

You haven't shown enough code and it's not clear what "gets stuck" means.

June 5th, 2012, 02:47 PM

tarkes

Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp

Quote:

Originally Posted by GCDEF

You haven't shown enough code and it's not clear what "gets stuck" means.