|
thanks, I'll look into those!
A brave person isn't always necessarily a smart person
bdiamond
|
|
|
|
|
Sorry, I think you misunderstood my question. I'm not talking about graphics. I mean design patterns as in 'singleton' pattern; applying patterns to frequently encountered programming problems or situations, if I understand the concept correctly.
[A brave person isn't always necessarily a smart person]
bdiamond
|
|
|
|
|
bdiamond wrote:
Sorry, I think you misunderstood my question.
Like I said, I know nothing about this.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
This book will help: <http://www.amazon.com/exec/obidos/tg/detail/-/0201633612/103-7334348-8442222?v=glance>
Hua-Ying
|
|
|
|
|
what book?
[A brave person isn't always necessarily a smart person]
bdiamond
|
|
|
|
|
There are some good books on Design Patterns
Design Patterns - Addison Wesley - Gamma, Helm, Johnson, Vlissides
is one I would recommend.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
thanks!! that's what I was looking for!
[A brave person isn't always necessarily a smart person]
bdiamond
|
|
|
|
|
|
thank you!
[A brave person isn't always necessarily a smart person]
bdiamond
|
|
|
|
|
I haven't read the "bible" on Design Patterns, i.e., the book by Gamma et al. However, I think you'll find Design Patterns Explained far more readable and accessible. The good thing about it is that it is problem-based, i.e., it first describes what the problem situation is and then moves step by step to design patterns.
Kevin
|
|
|
|
|
The classic Design Patterns book is "Design Patterns" by Gamma, Helm, Johnson, and Vlissides. Addison Wesley.
|
|
|
|
|
As others have said: "Design Patterns" by Gamma, Helm, Johnson, and Vlissides. Addison Wesley. It is the classic. It WILL end up on your bookshelf (unless something changes programing drasticly in the very near future), so if you don't buy it now, at least start planning on buying it.
Go to your local bookstore. There are several books on the subject, some of which are an easier read than the above. I started with Design Patterns Explained (I don't recall who wrote it, and I might have the tittle a little wrong), which is an easier introduction. There are others, take your pick.
I havn't found a website that is as good as books in this case. Perhaps because design patterns are basicly enough, and change so little, that books can cover them.
|
|
|
|
|
hi!!!
i'm just a beginer and doing F.Y MCS..we have a project submission as a partof our curriculum. and i'm trying to make a media player.. i'am using MCI interface.. can u help me with some suggestions? like i wanted to playback mp3 files and include some visualization.. Thanks
Vijayalakshmi Iyer
|
|
|
|
|
hi!!!
i'm just a beginer and doing F.Y MCS..we have a project submission as a part of our curriculum. and i'm trying to make a media player.. i'am using MCI interface.. can u help me with some suggestions? like i wanted to playback mp3 files and include some visualization..
Where can i find an algorithm for converting into mp3 files? Thanks.
Vijayalakshmi Iyer
|
|
|
|
|
I have been trying to make a 2d array of pictureboxes but it seems like a can't figuer it out.
I have been trying to do like this but it does work.
PictureBox* Array2d[][]= new PictureBox* [][];
|
|
|
|
|
This should create a 4x3 array of PictureBox objects:
PictureBox **pb = new PictureBox*[4];
for (int x = 0; x < 4; x++)
pb[x] = new PictureBox[3];
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Then how would you acces them ?
and thanks
|
|
|
|
|
Like any two-dimensional array:
pb[2][0] = ???; would assign a value to the following "cell" of the array:
-------
| | | |
-------
| | | |
-------
|#| | |
-------
| | | |
-------
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
Avoid raw arrays. I would use CArray or vector, eg., (in your case substitute PictureBox for int)
// ***************************************
// Example: Dynamic Multidimensional Array
// ***************************************
// We want both array dimensions to be allocated dynamically and
// to be able to reference an element as x[i][j]
// Here's how to do it...
// ***********
// MFC Version
// ***********
// Array of ints
typedef CArray <int, int> CIntArray;
// Array of arrays of ints
typedef CArray <CIntArray, CIntArray&> CMultiIntArray;
void TraceDynamicArray(const unsigned int rows, const unsigned int columns)
{
CMultiIntArray aTest;
// Allocate number of rows
aTest.SetSize( rows );
// For each row
for (int row = 0; row < aTest.GetSize(); row++)
{
// Allocate number of columns
aTest[row].SetSize( columns );
// For each column
for (int column = 0; column < aTest[row].GetSize(); column++)
{
// Assign a value
aTest [row] [column] = 10 * row + column;
// Trace it
afxDump << aTest [row] [column] << "\t";
}
afxDump << "\n";
}
}
// ****************************
// Standard C++ Library Version
// ****************************
// Array of arrays of ints
typedef vector<vector<int> > CMultiIntArray;
void TraceDynamicArray(const unsigned int rows, const unsigned int columns)
{
CMultiIntArray aTest;
// Allocate number of rows
aTest.resize( rows );
// For each row
for (int row = 0; row < aTest.size(); row++)
{
// Allocate number of columns
aTest[row].resize( columns );
// For each column
for (int column = 0; column < aTest[row].size(); column++)
{
// Assign a value
aTest [row] [column] = 10 * row + column;
// Trace it
cout << aTest [row] [column] << "\t";
}
cout << "\n";
}
}
// Example usage: Standard C++ Library version
int main(int argc, char* argv[])
{
TraceDynamicArray(3,5);
return 0;
}
// For rows = 3, columns = 5, produces output...
// 0 1 2 3 4
// 10 11 12 13 14
// 20 21 22 23 24
Kevin
|
|
|
|
|
"Avoid raw arrays. I would use CArray or vector."
Why?
I am kind of new in c++ and thanks.
|
|
|
|
|
See http://www.artima.com/intv/goldilocks.html[^]
Basically, we should all be using the modern, high-level features of C++. They are safer, more robust, easier to use (after a bit of acquaintance) and often just as efficient as the low-level stuff.
Have a look at Stroustrup's comments and papers on this. See also Paul McKenzie's posts at codeguru.com.
Stroustrup: "The problem with the C way is that if you write code C-style, you get C-style problems. You will get buffer overflows. You will get pointer problems. And you will get hard to maintain code, because you're working at a very low level. So the cost is in development time and maintenance time."
Kevin
|
|
|
|
|
|
i got a problem that i can't hook java application by VC++. So please give me documents or sample source code if you have this solution huh. Thanks for all. I'm waiting for all of you.
|
|
|
|
|
I am creating a server application using CAsyncSocket , i am able to recieve information from a client , how could i send reply back to connected client , at present i am able to accept only one client how could i make it for multiple clients...
this is code that i had written...
here async is a class derived from CAsyncSocket....
void async::OnAccept(int nErrorCode)
{
if( recvsocket==NULL )
recvsocket = new async;
//Create the new connection
if( Accept( *recvsocket,NULL,NULL ) == 0 )
{
return;
}
CAsyncSocket::OnAccept(nErrorCode);
}
here i declared recvsocket as
async* recvsocket;
in the async class....
void async::OnReceive(int nErrorCode)
{
char *pBuf = new char[1025];
int iBufSize = 1024;
int iRecv, iErrCode;
CString strRecv, Emsg;
iRecv = Receive(pBuf,iBufSize);
if (iRecv == SOCKET_ERROR)
{
iErrCode = GetLastError();
Emsg = "Error found! Error code: " + iErrCode;
AfxMessageBox(Emsg);
}
else
{
pBuf[iRecv] = NULL;
strRecv = pBuf;
AfxMessageBox(strRecv);
/* if (recvsocket->Send(pBuf,iBufSize) == SOCKET_ERROR)
{
AfxMessageBox("Send Error");
}
else
{
AfxMessageBox("sended");
}
*/
}
CAsyncSocket::OnReceive(nErrorCode);
}
Thank u.
Prasanna
|
|
|
|