|
Graham,
I want to thank you for your response. It has solved my problem. I am not a big fan of using
the operator << to print the results. I feel that this is best done by a member function. Therefore,
I wrote the function printIt. Therefore the operator << just needs to call printIt. I am also not
a big fan of using the keyword friend. I feel that giving non-member functions access to private data
of a class is not a good idea.
Bob
|
|
|
|
|
What are the limits of the drawing area in GDI?
I am using MoveTo(x, y), LineTo(x, y) GDI functions to draw multiple line. LineTo fails (returns FALSE) when the y is more than 1073741951 units.
GetLastError() return error code 534 - "Arithmetic result exceeded 32 bit"
So friends, any advice?
Thanks in advanced
Sandip
|
|
|
|
|
Calculations are probably done with 32-bit integers,
so you'll need to keep your coordinates scaled
to prevent the overflow. Pinning down an exact limit
would be difficult unless you know the actual calculations
being done by the system.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Both GDI and GDI+ are limited to 1073741951 pixel extents on both vertical and horizontal axis.
Best Wishes,
-David Delaune
|
|
|
|
|
Hello everyone,
I am shamed to ask this question because I can not figure out after some experiment. I think for reference variable, once it is binded, the target can not be changed.
But why in my following sample, pi can be binded to a and later binded to b without any issues?
int main()
{
int a = 10;
int b = 20;
int& pi = a;
pi = b;
return 0;
}
thanks in advance,
George
|
|
|
|
|
I don't know what you mean by "binded".
All you are doing is assigning a value to a variable...
You are free to assign any value to a non-const variable,
as many times as you want to.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks Mark!
Cool.
regards,
George
|
|
|
|
|
Heh don't thank me - my reply made no sense.
Jijo and Nemanja have it right
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Good man, thanks Mark! Participation is also appreciated.
regards,
George
|
|
|
|
|
George_George wrote: int& pi = a;
In this statement you're initializing your reference variable. Now pi refers to variable a .
George_George wrote: pi = b;
In this statement you're assigning a value to your reference variable which will updates the value of variable a . Don't get confused - This is not re-initialization, Its just assignment.
George_George wrote: I think for reference variable, once it is binded, the target can not be changed.
Yes. Thats right. You cannot re-initialize a reference.
<modified with respect to Mark's comment>
Once reference is initialized and binded to one variable, you cannot re-initialize it or re-bind it to point another variable. But in your case, the statement pi = b; is just assignment. Thats why its legal.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
modified on Sunday, August 10, 2008 1:33 AM
|
|
|
|
|
Jijo raj wrote: Yes. Thats right. You cannot re-initialize a reference.
What do you mean by that?
*edit* I see - you were illustrating the difference between<br />
initialization and assignment, right?
Thanks,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote:
*edit* I see - you were illustrating the difference between
initialization and assignment, right?
Yes Mark.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Cool, thanks Jijo!
regards,
George
|
|
|
|
|
Binding? the use of reference variable is that it can be made to point to anything. Imagine it like a minutes pointer in a wall Clock. It can be rotated any degree to point to I,II,III,IV . here a,b is just like the I, II. You can turn your reference onto anything. No binding happens, but "referencing".
|
|
|
|
|
|
George_George wrote: But why in my following sample, pi can be binded to a and later binded to b without any issues?
It is not. The line
pi = b;
does not bind pi to b , but assignes a new value to a
|
|
|
|
|
You are correct, Nemanja!
regards,
George
|
|
|
|
|
Hi, I just want to know if it's possible to access a vector object by it's unique id.
In vector objects don't have id's you can just access them by their locations!
for example:
std::vector<myobject> objs;
objs.at(1).my_property = 'qwerty';
here 1 is the location of the object in that vector and it's not unique..
it can change if you delete or add a object on top of this object.
but i want to give them a unique id and access them by that.
Any suggestions?
|
|
|
|
|
you must use a std::map instead if you want to identify a record with a unique key.
|
|
|
|
|
Hi all,
i m using *.chm as a help file of application.i m open this through menu of application.
In help file diffrent categories like Contents,Index,Search,Favorite etc.
i want if i click on contents menu than help file open with Contents category,same for others.
so please tell me how can i do this.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hi all,
i am trying to use a vista icon in my vc2005 application, by vista i mean that it changes it size according to its view. Now when i import that icon in my application and compile that application it gives error
error RC2176 : old DIB in G:\all__size_ico\Custom Software Box CD.ico; pass it through SDKPAINT
..
How to resolve this error???
Can anybody help me in this...
thanks in advance
|
|
|
|
|
|
Hello everyone,
Mentioned here,
--------------------
http://www.codeproject.com/KB/COM/CCOMThread2.aspx
However, one down side to this feature is that it does not support the marshaling of proxies. This is a disappointment because table marshaling of proxies is most useful in many situations especially in distributed applications.
To cater to this specific requirement, Windows NT 4.0 Service Pack 3 introduced the Global Interface Table (GIT).
--------------------
Really confused about reading it. Does it mean in current Windows version, GIT has supported the marshalling of pointer to proxies, but in early version of Windows, it is not supported?
thanks in advance,
George
|
|
|
|
|
Hello everyone,
When using GIT to perform inter-apartment marshalling, what is the guideline whether need to call Release method of GIT?
Currently, I just call Release in the methods,
- which register interface to be marshalled into GIT;
- which retrieves unmarshalled interface from GIT.
Not sure whether there are more accurate practices when we should call Relase.
thanks in advance,
George
|
|
|
|
|
Hi all,
i m using a dialogbox witout close button.i want this dialog box is auto close after some time.
so please tell me how can i do this?
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|