-
Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
I am creating an SDI to plot a picture pixel wise using pDC->setpisel()
I have a large 2D vector which is generate in PLOT button in a dialog . On pressing the 2d vector is generated. How will I pass this 2D vector to ONDRAW(CDC*pDC). So that i can process further the vector and put as pixels using for loop.. I donot know if ::Postmessage could workout.. How to use it if it does so??
I would be highly thankkful for ideas and sugestions
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Easy. The vector belongs with your app document class. Document is accessible from your view any time.
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
Igor Vartanov
Easy. The vector belongs with your app document class. Document is accessible from your view any time.
But how do i call the ONDRAW () from the ONBUTTON() in dialog class.. The vector was declared and created ONBUTTON function itself.. Actually it reads a text file and geenrated the vector..
I am bit new to visual C++ 6..
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
But how do i call the ONDRAW () from the ONBUTTON() in dialog class.
You must never call OnDraw directly. Instead, you call pView->Invalidate().
Quote:
The vector was declared and created ONBUTTON function itself.
And again, the vector belongs with your document class. This is your data to make drawing on.
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
Igor Vartanov
You must never call OnDraw directly. Instead, you call pView->Invalidate().
And again, the vector belongs with your document class. This is your data to make drawing on.
Yes that is true but pView->Invalidate() doesnot work.. It shows undeclared identifier
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
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
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
tarkes
Yes that is true but pView->Invalidate() doesnot work.. It shows undeclared identifier
Then set up a pointer to your view as a member of your dialog and set it before you call DoModal, or pass the view's pointer in as the parent of the dialog when you create it, and call GetParent from inside the dialog.
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
tarkes
Yes that is true but pView->Invalidate() doesnot work.. It shows undeclared identifier
What is a pView and where do you call this line from?
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
I have push button () in dlg.cpp file..There I have generated the vector by reading a text consists of number for calculations..
pView i declared there.
-
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?
I have push button () in dlg.cpp file..There I have generated the vector by reading a text consists of number for calculations..
pView i declared there.
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
tarkes
I have push button () in dlg.cpp file..There I have generated the vector by reading a text consists of number for calculations..
pView i declared there.
Quote:
Originally Posted by
VictorN
#
Code:
void CColourdlg::OnPlot()
{
// TODO: Add your control notification handler code here
//Getting number of rows and columns
int j=0,i=0,k=0,l=0,ncols=0, nrows=0;
double array[10][10]={0};
std::ofstream ofs;
CEdit *pEdit = (CEdit*)GetDlgItem(IDC_EDIT1);
LPTSTR lpData = new TCHAR[500];
ZeroMemory(lpData,500*sizeof(TCHAR));
pEdit->GetLine(0,lpData,500);
std::string line;
std::ifstream ifs(lpData,ios::nocreate);
//Declare a Matrix pointer
std::vector< std::vector<double> > vec;
//Store in Matrix
//ifs.open(lpData,ios::nocreate);
std::string lin;
while (std::getline(ifs, lin)) // read one line at a time
{
double val;
std::istringstream jss(lin);
std::vector<double> row;
j=0;
while (jss >> val) // read one value at at time from the line
{
row.push_back(val);
j++;
}
vec.push_back(row);
i++;
::MessageBeep((WORD)-1);
}
ncols=j;
nrows=i;
ifs.close();
std::vector<double>::iterator itr;
std::vector<double>::iterator col;
std::vector< std::vector<double> >::iterator row;
std::vector<double> vec_rmax;
for (row = vec.begin(); row != vec.end(); row++)
{
itr=std::max_element( row->begin(), row->end() );
vec_rmax.push_back(*itr);
}
itr=std::max_element( vec_rmax.begin(), vec_rmax.end() );
// Divide with maximum value
for (row = vec.begin(); row != vec.end(); row++)
{
for (col = row->begin(); col != row->end(); col++)
{
*col=(*col/ *itr);;
}
}
ofs.open("Matrix.txt");
//ofs<<vec[1][1];
for (k=0;k<nrows;k++)
{
for (l=0;l<ncols;l++)
{ofs<<vec[k][l]<<'\t';} ofs<<'\n';}
ofs.close();
OnOK();
}
This isthe code written to read text with tab separtaed values and vector i generated.. It is in dlg.cpp file ..Now I neeed to call this in ONDRAW(CDC pDC)..
Code:
void CContourPlotView::OnDraw(CDC* pDC)
{
CContourPlotDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
For eg in the
ONDRAW(CDC *pDC)
For (i=0 to end)
for j= 0 to end
//Do the operations
pDC->SETPIXEL(i,j,RGB(values,values,values) //I get values from VECTOR
//calculation
}}
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
tarkes
I have push button () in dlg.cpp file..There I have generated the vector by reading a text consists of number for calculations..
pView i declared there.
Where "there"? :confused: And how?
And what does it have to do with a pointer to existing View class object?
BTW, did you ever hear there is a lot of samples in MSDN, also for SDI with Doc/View architecture?
http://msdn.microsoft.com/en-us/libr...386059(v=vs.71)
http://msdn.microsoft.com/en-us/libr...386073(v=vs.71)
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
VictorN
I have attached the codes i had written.. pView i declared
void CColourdlg::OnPlot() ... that I was just experimenting if it was working..But i have deleted that...
These codes I had atached work perfectly and generated the vector in a text file.. The text file i was experimenting wether the desired output is obatined.. I donot need the text file. The vector has to be accesed in ONDRAW() which i will be using to calcute RGB values and use them in plotting pixels. I hope the problem is clear now..
Yes during my search i could find those links but I donot know those links donot work.. I think in this country it doesnot work...
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
You're not listening to the advice being offered. That tends to stop the help from coming.
As mentioned, data belongs in the document class.
Your dialog needs access to your view so it can invalidate it. I told you a couple of ways to set that up.
In OnDraw, call GetDocument() to get the data from the document object.
If you're going to ask for help, you should listen to it.
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
GCDEF
You're not listening to the advice being offered. That tends to stop the help from coming.
As mentioned, data belongs in the document class.
Your dialog needs access to your view so it can invalidate it. I told you a couple of ways to set that up.
In OnDraw, call GetDocument() to get the data from the document object.
If you're going to ask for help, you should listen to it.
Code:
void CContourPlotView::OnDraw(CDC* pDC)
{
CContourPlotDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
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..
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
gcdef
you're not listening to the advice being offered. That tends to stop the help from coming.
As mentioned, data belongs in the document class.
Your dialog needs access to your view so it can invalidate it. I told you a couple of ways to set that up.
In ondraw, call getdocument() to get the data from the document object.
If you're going to ask for help, you should listen to it.
sooryy ..extremely sorry.. I dodnot see your post.. I missed yours. Let me try your suggestion
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..
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
tarkes
Code:
void CContourPlotView::OnDraw(CDC* pDC)
{
CContourPlotDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
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?
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
tarkes
sooryy ..extremely sorry.. I dodnot see your post.. I missed yours. Let me try your suggestion
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.
-
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..
-
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..
-
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.
-
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??
-
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.
-
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.
Code:
void CColourdlg::OnPlot()
{
// TODO: Add your control notification handler code here
//Getting number of rows and columns
int j=0,i=0,k=0,l=0,ncols=0, nrows=0,R=0,G=0,B=0;
double array[10][10]={0};
std::ofstream ofs;
CEdit *pEdit = (CEdit*)GetDlgItem(IDC_EDIT1);
LPTSTR lpData = new TCHAR[500];
ZeroMemory(lpData,500*sizeof(TCHAR));
pEdit->GetLine(0,lpData,500);
std::string line;
std::ifstream ifs(lpData,ios::nocreate);
//Declare a Matrix pointer
std::vector< std::vector<double> > vec;
//Store in Matrix
//ifs.open(lpData,ios::nocreate);
std::string lin;
while (std::getline(ifs, lin)) // read one line at a time
{
double val;
std::istringstream jss(lin);
std::vector<double> row;
j=0;
while (jss >> val) // read one value at at time from the line
{
row.push_back(val);
j++;
}
vec.push_back(row);
i++;
}
ncols=j;
nrows=i;
ifs.close();
//pDoc->size.push_back(nrows);
//pDoc->size.push_back(ncols);
std::vector<double>::iterator itr;
std::vector<double>::iterator col;
std::vector< std::vector<double> >::iterator row;
std::vector< std::vector<int> > rgbvec;
std::vector<double> vec_rmax;
for (row = vec.begin(); row != vec.end(); row++)
{
itr=std::max_element( row->begin(), row->end() );
vec_rmax.push_back(*itr);
}
itr=std::max_element( vec_rmax.begin(), vec_rmax.end() );
::MessageBeep((WORD)-1);
// Divide with maximum value
for (row = vec.begin(); row != vec.end(); row++)
{
for (col = row->begin(); col != row->end(); col++)
{
*col=(*col/ *itr);
if (*col==0 || *col<0.142857)
{R=148;G=0;B=211;}
else if (*col==0.142857 || *col<0.285714)
{R=75;G=0;B=130;}
else if (*col>=0.285714 || *col<0.428571)
{R=0;G=0;B=255;}
else if (*col>=0.428571 || *col<0.571428)
{R=0;G=255;B=0;}
else if (*col>=0.571428 || *col<0.714286)
{R=255;G=255;B=0;}
else if (*col>=0.714286 || *col<0.857143)
{R=255;G=127;B=0;}
else
{R=255;G=0;B=0;}
std::vector<int> temp;
temp.push_back(R);
temp.push_back(G);
temp.push_back(B);
pDoc->RGBVector.push_back(temp);
}
}
ofs.open("Matrix.txt");
//ofs<<temp[0];
/*for (k=0;k<nrows;k++)
{
for (l=0;l<ncols;l++)
{ofs<<vec[k][l]<<'\t';} ofs<<'\n';}
ofs.close();
pView->Invalidate();*/
OnOK();
}
I have marked it red during looping. this is PLOTBUTTON() in Contoutdlg.cpp source file
Once it is updates the vector declared in Document.h I can acess it in ONDRAW()
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
:mad:
Please, edit your post adding Code tags aroung code snippet!
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
tarkes
I have marked it red during looping. this is PLOTBUTTON() in Contoutdlg.cpp
But you failed to use code tags when posting code. The code you posted is unreadable without proper use of code tags.
Second:
Code:
LPTSTR lpData = new TCHAR[500];
ZeroMemory(lpData,500*sizeof(TCHAR));
You're using vectors all over the place, so why did you not want to use it here? Because of this, your code has a memory leak every time you call OnPlot.
As a matter of fact, all you need to do is declare an array since you know the size already:
Code:
TCHAR lpData[500] = {0};
pEdit->GetLine(0,lpData,500);
If for some reason you wanted to use vector:
Code:
std::vector<TCHAR> lpData(500);
pEdit->GetLine(0, &lpData[0], lpData.size());
Either the array or vector version will not cause the memory leak.
Regards,
Paul McKenzie
-
1 Attachment(s)
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
I have attached a snap shot of working window showing CDOCUMENT.h file opened.. Please have alook at it
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
First. The code is almost unreadable because of using no code tags.
Second. What is pDoc- > RGBVector definition?
Quote:
Code:
std::vector<int> temp;
temp.push_back(R);
temp.push_back(G);
temp.push_back(B);
pDoc->RGBVector.push_back(temp);
Third. RGB perfectly fits into 32bit:
Code:
COLORREF temp = RGB(R, G, B);
EDIT: the latter means, there's no need to pile arrays on arrays. BTW, it seems you never care about cleaning RGBVector.
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
Paul McKenzie
But you failed to use
code tags when posting code. The code you posted is unreadable without proper use of code tags.
Second:
Code:
LPTSTR lpData = new TCHAR[500];
ZeroMemory(lpData,500*sizeof(TCHAR));
You're using vectors all over the place, so why did you not want to use it here? Because of this, your code has a memory leak every time you call OnPlot.
As a matter of fact, all you need to do is declare an array since you know the size already:
Code:
TCHAR lpData[500] = {0};
pEdit->GetLine(0,lpData,500);
If for some reason you wanted to use vector:
Code:
std::vector<TCHAR> lpData(500);
pEdit->GetLine(0, &lpData[0], lpData.size());
Either the array or vector version will not cause the memory leak.
Regards,
Paul McKenzie
For calculation puroposes i need values and so do i store it in vector format.. I have attached a screen shot as weel as i have quoted the code. Please have a look.
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Why are you declaring vectors in your dialog? Stop it. As I said before, it's really clear you're missing some fundamental concepts, more than can be introduced and explained in forum posts. Stop what you're doing. You're over your head. Spend some time learning how MFC, doc/view and dialogs work, and spend some time learning the basics of OOP. You can't learn this stuff by guessing and trial and error. It's too complicated.
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
tarkes
For calculation puroposes i need values and so do i store it in vector format.. I have attached a screen shot as weel as i have quoted the code. Please have a look.
That doesn't address the issue about the memory leak.
How many times is OnPlot() called? Multiply that by 500 (or more) bytes, and that is how much total memory is leaked by that function. So if the function is called 1,000 times, that's 500,000 bytes leaked. Sooner or later, your app will die due to the memory leakage.
There is no need to be using new[] in that OnPlot() function. Either declare a regular array, or use vector<TCHAR>. It makes no sense to use vector everywhere and then not use it for what vector was designed for.
Regards,
Paul McKenzie
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
pDOC is a pointer as declared
Code:
CContourPlotDoc *pDoc;
in colourdlg.h
I have attached the screen shot of all files existing..Please kindly have a look
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
Paul McKenzie
That doesn't address the issue about the memory leak.
How many times is OnPlot() called? Multiply that by 500 (or more) bytes, and that is how much total memory is leaked by that function. So if the function is called 1,000 times, that's 500,000 bytes leaked. Sooner or later, your app will die due to the memory leakage.
There is no need to be using new[] in that OnPlot() function. Either declare a regular array, or use vector<TCHAR>. It makes no sense to use vector everywhere and then not use it for what vector was designed for.
Regards,
Paul McKenzie
ONPLOT() is not called repeatedly. On pressing the PLOT button in a dialog box designed it starts executing the codes writen to generate the RGB vector.
Further I would like to make a note that when i remove this line
Code:
pDoc->RGBVector.push_back(temp);
everything works fine..Loops and all run fine.. Nothing gets stuck ..
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
tarkes
pDOC is a pointer as declared
Code:
CContourPlotDoc *pDoc;
in colourdlg.h
And how and where is it initialized?
Quote:
Originally Posted by
tarkes
I have attached the screen shot of all files existing..Please kindly have a look
Please, don't attach such types of screenshots.
Attach the appropriate code snippets instead! And son'tr forget using Code tags and proper indentations.
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
VictorN
And how and where is it initialized?
Please, don't attach such types of screenshots.
Attach the appropriate code snippets instead! And son'tr forget using Code tags and proper indentations.
Initialize ?? I couldnot get it. I declared that pointer so as to have acess the vectors in Dialog class and assign the values to the vectors
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
tarkes
ONPLOT() is not called repeatedly. On pressing the PLOT button in a dialog box designed it starts executing the codes writen to generate the RGB vector.
Again, how does this address the memory leak in that function??. It doesn't matter if it's called once or a million times, the function has a memory leak, and I told you how to fix it.
Regards,
Paul McKenzie
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
Paul McKenzie
Again, how does this address the memory leak in that function??. It doesn't matter if it's called once or a million times, the function has a memory leak, and I told you how to fix it.
Regards,
Paul McKenzie
Ok arrays may be will help out
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
tarkes
Initialize ?? I couldnot get it. I declared that pointer so as to have acess the vectors in Dialog class and assign the values to the vectors
Maybe this is the main point. Declaring a pointer never means you're allowed to use it uninitialized. Declaration doesn't do any magic, it just allocates some memory and instructs compiler about what type it is. You must fill it with the address of your doc class before first use. Man, seems GCDEF is right, and you have to get back learning pointers before doing anything real.
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Basically I am related to mechanical. I am not so big expert in computer science field that i will understand everything in one shot. I have done C++ but for simple programs. Here in visual C++ many classes, handles and I dont know hell lot of functions are available..
I really getting mad. Some part i could understand.. Some part i get confused where to write...
i am using to for my some research purpose..
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
tarkes
Basically I am related to mechanical. I am not so big expert in computer science field that i will understand everything in one shot. I have done C++ but for simple programs. Here in visual C++ many classes, handles and I dont know hell lot of functions are available..
I really getting mad. Some part i could understand.. Some part i get confused where to write...
i am using to for my some research purpose..
And you're going to keep getting mad because you're trying to do too much too soon. There is a HUGE learning curve with C++, MFC, OOP and Windows programming, especially when you try to do them all at once as you are. I would expect it to take months to learn all you need to learn to do what you're trying to do. If you're expecting to bang this out in a day or two, you need to adjust your expectations.
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
tarkes
Basically I am related to mechanical. I am not so big expert in computer science field that i will understand everything in one shot. I have done C++ but for simple programs. Here in visual C++ many classes, handles and I dont know hell lot of functions are available..
I really getting mad. Some part i could understand.. Some part i get confused where to write...
i am using to for my some research purpose..
Then why did you ignore to learn something using MSDN samples I referred to in one of my previous posts?
It is what you had to begin with (just after reading the corresponding documentation)
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
GCDEF
And you're going to keep getting mad because you're trying to do too much too soon. There is a HUGE learning curve with C++, MFC, OOP and Windows programming, especially when you try to do them all at once as you are. I would expect it to take months to learn all you need to learn to do what you're trying to do. If you're expecting to bang this out in a day or two, you need to adjust your expectations.
Can you suggest me some good books or tutorials where i could understand. I followed up some books like Visual C++ in 21 Days and some such books.. There I just find how to add something and plot something .. but i dont find as simple i am looking for..
MSDN tutorials are not working. May be that could have been benficiary but bad luck...its not working in this country
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
VictorN
The why did you ignore to learn something using MSDN samples I referred to in one of my previous posts?
It is what you had to begin with (just after reading the corresponding documentation)
Sir Badluck that website u sent i found those links earlier from someothe websites. Its not working in India .. I gues its working only in US
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
tarkes
Sir Badluck that website u sent i found those links earlier from someothe websites. Its not working in India .. I gues its working only in US
Define "not working"
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
tarkes
Sir Badluck that website u sent i found those links earlier from someothe websites.
You showed a lack of very basic understanding in C++, not handles or MFC classes. But you cannot expect to understand MFC or any other framework without good knowledge of C++ basics. I would suggest you to switch to some other language, like VB.NET or C# (Express version from MS is for free!), where the learning curve is not that steep.
Quote:
Its not working in India .. I gues its working only in US
Well, MSDN works just fine all over the world, in US, Russia, Japan, Israel, Europe but fails to work in India. Very bad news.
Quote:
Basically I am related to mechanical.
Whatever you're related to, any branch of engineering or science, computer, mechanical, whatever, you cannot skip learning basics. BTW, no matter what language you eventually choose, start reading books more solid than "..in 21 days" crap.
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Can you suggest me some good books or tutorials
I can suggest you to make use of Search here on CodeGuru. There are lots of recommendations already made before, and there's no need to duplicate that.
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Quote:
Originally Posted by
VictorN
Define "not working"
Home Library Learn Downloads Support Community
Sign in | United States - English | |
Page Not Found
MSDN
We're sorry, but the page you requested could not be found. Please check your typing and try again, or use the search option on this page.
This is what the message comes in the website and this is what not working means
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
The first link shows me alittle mor info than you have posted
Quote:
HomeLibraryLearnDownloadsSupportCommunity
Sign out | United States - English | |
Page Not Found
We could not find the page you requested.
Here are some other pages that may be related to: Search MSDN with Bing
Search Results
Documents Samples
The
SCRIBBLE sample shows how to implement a CDocument derived class. SCRIBBLE is a good model for any application that can rely on the framework's standard user ...
http://msdn.microsoft.com/en-us/libr...(v=VS.71).aspx
Now you can click on the SCRIBBLE link and go to this site. Please, read it carefully and if your VS version in not 2003 / choose another version...
If you didn't install VC++ samples then could search for their download in MSDN. For example, here you could find "Microsoft Visual C++ 2008 Sample Library"...
PS you have to learn using MSDN and other Web search. Try Google, it will help you! :rolleyes:
-
Re: Pass a vector from a pushbutton in dialog class to ONDRAW () in the view.cpp
Heloo every one.. The problem is solved. I designed the SDI and I got the results as i wanted. Thanks every1 to the hints given by every1.
Special thanks to GCDEF who gave the main hint for solving it. I could understand how to use it. I guess learning visual C++ is sit and solve any problem then get practiced to it
Thanks every1