|
From memory GetCursorPos() returns the point in screen coordinates and GetSubItemRect() is in client coordinates, so you need to convert one to the other. See ScreenToClient() and ClientToScreen().
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Thank you so much... I didn't notice that point !!!!
MaestroProgramador.Com
I didn't fail hundred times, I found hundred ways that didn't work.
No fallé cien veces, encontré cien maneras de que no funcionara.
|
|
|
|
|
hi can someone tell me exactly what a shallow copy
does it or is it a refrence
is it good or bad to use
|
|
|
|
|
Say you have a structure that looks like this:
struct
{
int x ;
char* p ;
} ;
If you copy an instance of this structure, the int will copy fine since it is a simple data type but the char* pointer causes problems.
If you just copy the value of p over (a shallow copy), you will have two instances of your structure that have a pointer to the same string. This causes problems when cleaning up - who has responsibility for free'ing the string? You don't want to do it twice.
A deep copy does an intelligent copy - it will make copies of the structure's data members where necessary. In this case, it will allocate a new block of memory and copy the string data over.
"Sucks less" isn't progress - Kent Beck [^]
Awasu 1.1.3 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
bhangie wrote:
what a shallow copy does
The copy is shallow when only the pointer is copied:
void ShallowCopy(int* a)
{
int* b;
b = a;
}
The copy is deep when the value at which the pointer points is copied:
void DeepCopy(int* a)
{
int* b;
*b = *a;
}
bhangie wrote:
is it good or bad to use
Depends on the situation. If a shallow copy is deleted, the original pointer no longer points to the expected data, which of course can be disasterous.
That's one reason to implement copy constructors in C++, to ensure member pointers are copied correctly.
--
Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. (Douglas Adams)
|
|
|
|
|
Hello All,
I am new to this Forum and need some details. I plan to Study C++ , can anyone suggest a good book to get a good working Knowledge of teh Language.
I am Studying in a College, and staying in a Hostel, so my resources are limited, I can access a Computer terminal 24 Hrs, but won't have access to Visual C++, Can anyone suggest the next best alternative, that is free for Download and can help me in my Objective ????
I know that this section might not be the best place to ask this query, But i need advice immediately. I'd be grateful if anyone can pass on any info regarding this. Looking forward to hearing from you all.
Regards,
Ajit
|
|
|
|
|
|
Thanks for the Response. Any idea of the next best alternative to Visual package to execute these programs.
Regards,
Ajit
"Insanity is my Birth Right!!!!"
|
|
|
|
|
|
How to use the source code run in visual c++ after download from this website?
|
|
|
|
|
Double-click the .dsw file and build the application (menu Build ).
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
How to laod a bitmap over a button?Also i want to change the bitmap when I click the button...
Boby
boby
|
|
|
|
|
u can use speen button or bitbtn! look at it's proerties and change..
|
|
|
|
|
You should insert your bitmaps into your resource file and then load them into your code. CButton class has its own functions for loading bitmaps from resources.
MaestroProgramador.Com
I didn't fail hundred times, I found hundred ways that didn't work.
No fallé cien veces, encontré cien maneras de que no funcionara.
|
|
|
|
|
hi boby
u can use the CIconicButton class or CRolloverButton class for this task.
u can find this class form codeproject site
|
|
|
|
|
Hi All,
I need to detect the mouse/keyboard clicks on one windows application so that I can send the same to another identical application running on another pc and have it do the same stuff.
I am having trouble figuring out how to monitor events on an application externally from another application (meaning I can't modify the code of the application whose events I want to monitor).
Any ideas or advice. Need HELP!! Thanks.
Regards,
Zahid
|
|
|
|
|
Look for "Hooking" or "Hooks".
Hosam Aly Mahmoud
|
|
|
|
|
I am using SQL SERVER 7.0 with OLE DB connection, i can display and add arabic text to the database, but when i try to run sql command to query arabic text i got no results, with out arabiic it is working.
Sinan Swedani
|
|
|
|
|
Can guarantee that 0 or -1 will not to be a threadid in my applicaton in any version of windows??
John
|
|
|
|
|
|
Do you know if a new thread always has bigger id value than a thread created earlier? Thanks.
[Edit]Just verified on my XP, the answer is no.[/Edit]
My articles and software tools
|
|
|
|
|
Since I don't have the NT source handy, I can't say. But if true, that's an internal implementation detail that you should not even consider relying on.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Kosh reminded me of some of the prima-donna programmers I've worked with. Knew everything but when you asked them a question; never gave you a straight answer.
-- Michael P. Butler in the Lounge
|
|
|
|
|
|
This was what I was thinking but I was not sure about that. I have never noticed an application with a thread id of 0 but if I assume this and I am wrong in the highly unlikely case that the thread had an id of 0 the program would crash.
John
|
|
|
|
|
It has been stated as a fact from AMD, that chips with a speed greater than or equal to 300Mhz conflict with Win95 OSR2. Explicitly, the boot process yields the message,
"While Initializing Device IOS: Windows Protection Error. You Need to Restart Windows".
This is the message I recieved after a clean install of 95 with a K6-2 500Mhz processor. I did get 95 to boot by clocking the chip down to 166Mhz. I then tried to install the chip update from AMD's web but recieved a message about a Restriction error. The details of the error are as follows:
caused an exception c0000006H in module at 0000:bff832f3.
Registers:
EAX=20040000 CS=0137 EIP=bff832f3 EFLGS=00010206
EBX=01047000 SS=013f ESP=827e4c84 EBP=827e4cb4
ECX=81789200 DS=013f ESI=0000100d FS=0da7
EDX=c10d1700 ES=013f EDI=0100d000 GS=0000
Bytes at CS:EIP:
08 0f 6a 00 6a 01 56 68 0d 00 01 00 e8 d0 e0 fe
Stack dump:
20040000 000002bb 00000014 81789064 00000050 00000003 00000000 00000003 00000000 00000000 00000001 817892bc 827e4e00 bff85528 00000014 00000000
The only conclusion this message gives me is that the K6 and K6-2 register and stack architecture don't coincide. How can I get the processor to run at 500Mhz?
|
|
|
|