|
Heh, please don't take this as if I am being flippant.
Even after nearly 20 years of programming, I still find that many of my initial designs are junk and have to be thrown away. Sometimes in the long run you save more time by starting again with good solid design than trying to patch together a bad design. Then again, if you actually have to maintain the code, it is always best to work from a good solid design.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
How can I disable my client's menu to appear instead of the default menu
erez@aliroo.com ?
|
|
|
|
|
Hi all,
I tried to show Message when user press CTRL + H in OnChar() !
OnChar function has 3 parameters which first parameter is the KEY ...
I don't know the usage of third parameter ...
Can you write small source ?
Please help me
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I always use GetAsyncKeyState to check for control in OnChar.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
Thanks for your help
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
hello. i am trying to write an alpha-beta function called CheckForMove that searches the best move on the board. here is my function...
// Searches for the best computer move on the board
int CComputer::CheckForMoves(int Depth, int Alpha, int Beta, int& Row, int& Col)
{
// Check if the Entered Depth is greater than the Maximum depth
ASSERT(Depth >= MAXDEPTH);
// point the board to a new board
CBoard Board = *mpBoard; <-- here is the problem
// Test for the values for now
Alpha = Beta = 0;
Row = Col = 1;
return 0;
}
when i created a new board and pointed mpBoard which is a Global member function to the Computer class, something is going wrong. so i tried commenting out that and the whole program works. its seems like the problem was on the Copy constructor, because its not copying it correctly i decided to write a new one. it wrote a copy constructor but its still not working write.
// Copy Constructor
CBoard::CBoard(const CBoard& Original)
{
// Copy all the values
Copy(Original);
}
// Copys all the objects
void CBoard::Clone(const CBoard& Copy)
{
// Create new objects
mpPen = new CPen;
mpFont = new CFont;
// Set the values to the new values
mpPen = Copy.mpPen;
mpFont = Copy.mpFont;
// Sets the rectangle to a certain point, width and height
for (int r = 0; r < MAXROW; r++)
for (int c = 0; c < MAXCOL; c++)
{
mCell[r][c] = Copy.mCell[r][c];
mpGrid[r][c] = new CRect( mLeftTopPt,CSize (mCellWidth,mCellHt));
mpGrid[r][c] = Copy.mpGrid[r][c];
}
}
This function compiles correctly. When i use to function CheckforMove it returns the row and column but, its not Drawing the board. i think somehow the mpBoard is getting overwritten because nothing the board is being drawn right. am i missing anything in my Copy Constructor or something. i tried tracing it and putting assert statements but i cant find the bug. can anyone Help me?
|
|
|
|
|
John Cruz wrote:
// point the board to a new board
CBoard Board = *mpBoard; <-- here is the problem
You have to define an assignment operator in your CBoard class as the above code calls it
CBoard& CBoard::operator=(CBoard&)
If there is no overloaded operator= member function then there is a bitwise member copy which is dangerous if you have pointer data members.
Atul Dharne
|
|
|
|
|
I want to be able to run a file trunsfer via FTP from a Win32 application.
Does anyone knows how?
Thanks
|
|
|
|
|
|
I need to select first item in virtual list control (CListCtrl with LVS_OWNERDRAW style set). Is any notification handler exists that notifies then CListCtrl finished collect data?
Sorry, if I confuse you with explanation
Thanks in advance
|
|
|
|
|
I have a program which deals with tabular data. Is there a quick and simple way to output data in excel file format?
Happy programming!!
|
|
|
|
|
I believe it's fairly simple using Excel as a COM object, i.e. only if Excel is installed on the machine.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
The quick and dirty way is to output it as a CSV format. Excel can then read the CSV format.
Michael
|
|
|
|
|
Yes that is the idea at the moment but we would prefer to output to the format directly which might also avoid complications of text that has comma as part of it.
Happy programming!!
|
|
|
|
|
When using the Trace statement in MFC where does it output it. coz ive tried look for it when in the debugger and it wont out the string inside my Trace statement. can anyone help me? thank you very much...
john
|
|
|
|
|
It's output to the output window, which may not be visible. It's output only in debug builds, and possibly only when you run in debug mode.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
|
Note that TRACE is a layer over OutputDebugString. See the docs on it for more info.
|
|
|
|
|
I'm writing a program that gives each user his/her own option, but I need to know when a user logs on to kick the option in, or when a user switches to another user(doesn;t log off) and then switches back without logging off or on. I've been searching for days and can find nothing on it. Anything at all will be greatly appreciated. Thx
|
|
|
|
|
Do you mean when the user logs on/off Windows or your program ?.
If it's windows, i think you'll need to write a GINA, a replacement to the windows security access (the logon dialog, shutdown, etc..) I've written one a few weeks ago for Windows NT 4/2000
There is an example on msdn, search for GINA.
Is not an easy task, I'm not sure this is the of solution you are looking for.
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
Yes For WIndows, I WIll look it up thanks
|
|
|
|
|
No I don't want to do that, I just need to know if the user who is , logged on and when they log on, or switch to another user.
|
|
|
|
|
Sorry, I don't get it, could you explain more ?.
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
Do a search on MSDN for WTSRegisterSessionNotification
Michael
|
|
|
|
|
Can't Find anything on that
|
|
|
|