|
Microsoft Press books can be preferred.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
thank you
|
|
|
|
|
Do you want to learning VC
whitesky
|
|
|
|
|
I used IHTMLBodyElement to set the background picture,but I can't set the repeat property,and background-position-x,background-position-y.
What can I do?
|
|
|
|
|
I have solved the problem.
;)
|
|
|
|
|
I'm trying to learn C++, so I'm just building some sample classes to get some experience. I have a matrix class in which I have implemented an addition operator that looks like this...
matrix operator + (matrix& toAdd)
{
// Create a zero matrix to output.
matrix output = matrix(toAdd.get_rows(), toAdd.get_cols(), 0);
// A temporary variable for the sum of each element
double val;
// Go through every element and add them together
// Stick the result in the output matrix
for(int i = 0; i < nrows; i++)
{
for(int j = 0; j < ncols; j++)
{
// The array indices are always 1 less
// than the row or column number
val = elements[i][j] + toAdd.get_el(i+1,j+1);
output.set_el(i+1, j+1, val);
}
}
return output;
}
It's nothing fancy... hopefully you won't need to see the whole class to understand the problem.
I wanted to pass it a matrix by reference in case the matrix is huge. I figure it'd probably be good form to add a const so that it is
matrix operator + (const matrix& toAdd)
but if I add that in, it doesn't compile. I get errors like
"passing 'const matrix' as 'this' argument of 'int matrix::get_rows()' discards qualifiers"
I get one of those errors for every time I use a member function of toAdd. Without const, everything's fine, but the matrix referred to as toAdd is vulnerable to changes. I am using gcc (or, more accurately, g++) to compile. Let me know if you need more information. Thanks!
-Mark
|
|
|
|
|
a const object can handled by a member function qualified by const
never say die
|
|
|
|
|
change your prototype into :
matrix operator + (const matrix& toAdd) const
for the same, if you say that the parameter toAdd is const , then toAdd.get_el() will crash if matrix::get_el() is not defined as const member function
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
MALDATA wrote: "passing 'const matrix' as 'this' argument of 'int matrix::get_rows()' discards qualifiers"
Make the get member functions const:
int matrix::get_rows() const<br />
{ ... }
You can only call const methods on a const object.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
codes here:
//////////////////////////////////////
// fill the screen with pure color
CWindowDC dc(NULL);
CRect rect;
GetWindowRect(&rect);
CBrush br;
br.CreateSolidBrush(RGB(255, 0, 0));
dc.FillRect(&rect);
the problem is :
I want to recover to the status that the screen is not filled , how to recover?
does InvalidateRect can do it ?
why I refresh the desktop, the screen is recovered to the old style?
please give me some help, waiting for answers online!
my Email is : xuwenq88@126.com
Just my interest for these common things
|
|
|
|
|
|
Simply to repaint the desktop use this
::InvalidateRect(0, NULL, TRUE);
nave
|
|
|
|
|
hello everyone!
I have just started learning VC++. Can anyone suggest me a good book for starting with VC++. I know C++ well. I dont have any idea of MFS, SDK etc.
Plz suggest me something,
Thanks,
|
|
|
|
|
I suggest posting this in the VC++/MFC forum. I am certain you'll get a lot of suggestions there.
Would help to know your technical/coding background.
|
|
|
|
|
This is the Visual C++ / MFC forum
|
|
|
|
|
Guess I was the one confused. Thought I was in suggestions at the time.
|
|
|
|
|
|
I'll second that recommendation. Best getting started book on MFC for any level programmer. Problem is it's out of print but worth the price the used copies are going for nowadays.
|
|
|
|
|
Which Book is in out of print, I hope u r not mentioned clearly.
|
|
|
|
|
sach!! wrote: have just started learning VC++. Can anyone suggest me a good book for starting with VC++. I know C++ well. I dont have any idea of MFS, SDK etc.
Learn VC++ in 21 days! good book to start Vc++ step by step!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
In a Grid control (TstringGrid of BC++) when I click on the scroll bar a message box appears and in parallel the scroller scroll down (in win xp os). But in win2000 the Scroller scrolls only after closing the message Box. Can any body tell how to change the behavior in XP so that it works like win2000?
|
|
|
|
|
Hello all! i have been working on a project that has several forms, and one of them must be opened in the second monitor if available, i am a newbie in c++ but is there any way to achieve this?
many might laugh at me because i am different, i laugh at them because they are the same
|
|
|
|
|
Hi,
I am using Visual Studio 2005. I was using some macros in my code. What I found was that I was unable to reference __LINE__ macro. The output of macros was wrong. I have created a sample and following is the code snippet -
#define TMP_THIS_FILE SimpleTrace_cpp<br />
#define TMP_EVAL(_value_) _value_<br />
#define TMP_(Id) TMP_EVAL(TMPFUNC_) ## TMP_EVAL(Id) ## TMP_EVAL(_) ## TMP_EVAL(TMP_THIS_FILE) ## TMP_EVAL(__LINE__)<br />
<br />
#define doTrace TMP_(CALL)
At line number 22 in my CPP file, If I make a call to -
doTrace();
Then the output should be
TMPFUNC_CALL_SimpleTrace_cpp22()
Instead the compiler is generating -
TMPFUNC_CALL_SimpleTrace_cpp()
And I get a compiler error saying
e:\projects\temp\temp\SimpleTrace.cpp(22) : error C3861: 'TMPFUNC_CALL_SimpleTrace_cpp': identifier not found
Any idea whats going wrong with the compiler? Also do I have to add any compiler switches to use __LINE__ in VS 2005?
S o h a i l K a d i w a l a
modified 21-Apr-21 21:01pm.
|
|
|
|
|
After slogging for couple of hours on this problem, I found the cause.
Change the "Debug Information Format" setting on the C/C++ project setting tab. The setting that does not work is "Program Database for Edit and Continue"; the setting that works is "Program Database".
Thanks a lot to people at Decompile.com. The page with information can be found at http://www.decompile.com/cpp/faq/file_and_line_error_string.htm[^]
I battled this problem for past few hours, finally posted on this forum and found the solution myself in next 5 min
Posting the solution here incase it saves time for someone stuck with same problem in future.
Just curios, is this a known problem and documented somewhere?
S o h a i l K a d i w a l a
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I have a SDI application - one CSplitterWnd and two CView derived panes, top and bottom. We all know that top pane remains "docked" and bottom pane's size changes while resizing main window. I need exactly the opposite: the top pane's size has to change and the bottom pane's height must remain fixed while resizing main window (just like there was a docked control bar at the bottom of the main window). Is this possible (and how)?
--
Vladimir Svrkota,
CardWare
Novi Sad, Serbia.
|
|
|
|