|
sory,but i dont understand:i have a SDI app,and lets say member variable
int x
in CTestView class,and i want to load variable
int y
in CTestDoc class with x and do something with y,for example
y+=10;
How to do that?i need this for some ODBC code when using CRecordset *m_pSet from CTestView in CLeftView and CTestDoc
classes.
|
|
|
|
|
Assuming you are doing this from the document class :-
CTestView *pTView=(CTestView*)AfxGetMainWnd()->GetActiveView();
y=pTView->x;
y+=10;
Nish
I am looking for a free racing game. Old style racing game without any complicated 3D stuff. Around 4 MB download. If anyone has such a game, please inform me.
|
|
|
|
|
Hi,
I have written the following code to find a string in the combobox.But it always returns CB_ERR .
char the_resstring[MAX_PATH];
itoa(the_nIDRes,the_resstring,10);
nIndex=m_combo.FindStringExact(0, the_resstring);
if(nIndex==CB_ERR )
AfxMessageBox("fails");
Any idea?
Neah
|
|
|
|
|
Are you absolutely sure you actually the string you're looking for is in the combo?
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
Yes,I am sure,i had inserted string through Insertstring() command.
|
|
|
|
|
And your combo has strings which are numbers? And one of them is the_nIDres?
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
|
While there's a possibility that you've found a Windows/MFC bug, I'd suggest reviewing your code. Maybe you have some spaces before/after numbers, etc.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
I had checked everything,it is fine..
|
|
|
|
|
Try with setting 1st param to -1 instead of 0. If this doesn't help, try to output strings with TRACE and CComboBox::GetLBText.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
Can you put the code?
Reagards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
You need to start from -1 if you want that find the string from the beginning...
Neha wrote
nIndex=m_combo.FindStringExact(0, the_resstring);
You are informing 0 and not -1....
Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Well, according to MSDN the search wraps at the end of combobox and starts from the beginning if you pass non-negative value, so it should have no effect. But it's worth trying anyway.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
hi everyone..
i am using the gridctrl from chris maunder with great success.. and i really like it.. i have made some changes, that make my life with it easier.. one of the changes requires a message to be sent to the parent window..
my question know would be, what ID should i use for my message..
chris used the LVN_ Messages (from CListCtrl i guess).. the message i am sending has got no LVN_ Counterpart, so which number should i use for this message?
* is WM_USER appropiate
* or should i adapt an LVN_ Number
i am thankful for any advice.. the only thing is that my weekend starts in one hour, and so i won't be able to thank the guys that will help me (if anyone helps me)
so.. thanks in advance, have a nice weekend
bernhard (king of sparetime and part - time programmer)
Sometimes I think the surest sign for intelligent life elsewhere in
the universe is that none of them ever tried to contact us.
|
|
|
|
|
I have a problem while creating the Bitmap for an image not displayed on my view.....
I create a Bitmap of my current view.. this is done perfectly as it takes care of the scroll position and other factors...
but i want to create a bitmap of another image, which is not displayed on my current view. While creating this second bitmap, it has to be created with reference to the scroll position of my first Bitmap ...
The object of creating this second Bitmap, is to map both index positions of the 2 bitmaps correctly, so that one bitmap can be merged into the other
Thank You
|
|
|
|
|
can anyone help me find my bug. i wrote a function that would search the tictactoe board for the best possible computer move. i am using alpha beta pruning to optimize my search. the function returns the score from the search and the row and column where the computer should move. ok here is the function... the PossiblePlayerMove function is the same thing but it searches for the best possible player move.
int CComputer::CheckForMoves(const CBoard &rConstBoard,int nDepth, int nAlpha, int nBeta, int &nRow, int &nCol)
{
// Check for invalid data
ASSERT(mnDepth >= 0 && mnDepth <= MAXDEPTH);
// Check if the row and column return is a valid value
ASSERT(nRow < MAXROW && nCol < MAXCOL);
int nScore = 0; // The score from the search
mnDepth = nDepth; // Set the Depth to the new depth.
int Row = nRow; // Copy the Row and Column
int Col = nCol;
// Create a new Board and Copy the values of other board.
CBoard Board = rConstBoard;
// Base Case
if (Winner(Board) || mnDepth == 0)
{
nRow = Row;
nCol = Col;
return Evaluate(Board);
}
else
{
// Try all the possible move on a different Board
// then return the best move.
for (int row = 0; row < MAXROW; row++)
for (int col = 0; col < MAXCOL; col++)
if (Board.IsEmpty(row,col))
{
Board.SetCellValue(row,col,'O');
if (mnDepth == 0) break;
nScore = PossiblePlayerMove(Board,mnDepth - 1,nBeta,nAlpha,Row,Col);
// Set Row and Column
nRow = Row;
nCol = Col;
if (nAlpha < nScore)
nAlpha = nScore;
Board.SetCellValue(row,col,NULL);
if (nAlpha >= nBeta) break;
}
}
return nAlpha;
}
i hope this is enough... by the way.. the possible moves function is the same thing ...
Thank you very much,
John
Aloha from Hawaii
|
|
|
|
|
hi,
dose anybody no of any code that will refresh/clear all the edit boxs, radio buttons on my dilog. By the press of one button
thanks
|
|
|
|
|
You'd need to write that yourself, becuase noone knows which edit boxes and how many are in your dialog.
Just SetWindowText() them all to a blank string.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
www.dictionary.com
If you're using poxy DDE you can reset all your variables and call UpdateData(FALSE);
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
|
|
|
|
|
DDE? Or DDX?
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
I toyed with the two, trying to remember which is which. I changed it twice, looks like I should have changed it once.,
Whatever it's called, it's useless.
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
|
|
|
|
|
Christian Graus wrote:
Whatever it's called, it's useless.
Why is it useless ?
What don't you like about it ?
|
|
|
|
|
CG doesn't like things which don't belong to STL
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
Bwhahahaha - excellent point
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 data validation rules are obtrusive and annoying. I always roll my own, because otherwise the user gets a million 'please enter a number dialogs in inappropriate times - for example if I empty the dialog I'll get one before I type in a new number.
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
|
|
|
|