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

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

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

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.

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

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..

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

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.

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

Originally Posted by VictorN

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

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()