|
cedric moonen wrote:
So next time you'll have to write with your nose
Oh, I Can try but My Spects create Problem
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
that's ok for me !
wow, i'm still 10 minutes late... Alok's really too fast... i cannot contest :->
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
No thats not it either...
Blog[^]
|
|
|
|
|
Hello,
an INT_PTR is NOT a pointer to an int! It is basically an int. If you compile under 32 bit, the INT_PTR is __int32, if you compile under 64 bit, it is an __int64. This is because the default size of an int is 64 bits on a 64 bit compiler instead of 32 bits.
The main advantage of the INT_PTR is that you get the same warnings when you ocompile under a 32 bit compiler as if you were compiling under a 64 bit compiler. This helps you to prepare to write portable code for the 64 bit platform.
If you are not planning to write portable code, you can simply ignore those warnings or #pragma them away:
<br />
#pragma warning(disable : /*warning number here: 4003*/)<br />
Hope this helps
Blog[^]
|
|
|
|
|
HI Bob,
Here what My local copy MSDN (OCTOBER 2001) state About INT_PTR
"
INT_PTR Signed integral type for pointer precision. Use when casting a pointer to an integer to perform pointer arithmetic.
"
May be defination of INT_PTR changed in RECENT Releases!.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Here is the declaration from the VS2005 library:
typedef _W64 int INT_PTR, *PINT_PTR;
I just love the PINT_PTR type
Blog[^]
|
|
|
|
|
Bob Stanneveld wrote:
VS2005 library:
Thats why I mention, I have MSDN October 2001 Edition!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
That version doesn't get updated anymore. I still have it too, but if I need to know something about other things than api's, I use MSDN online.
It's difficult to find the definition of INT_PTR on MSDN online, since it gives you results with every function returning an INT_PTR..
Blog[^]
|
|
|
|
|
Bob Stanneveld wrote:
I just love the PINT_PTR type
It's a pointer to a pint - tells us where to go after work
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
|
Bob Stanneveld wrote:
This is because the default size of an int is 64 bits on a 64 bit compiler instead of 32 bits.
Nope. int is still 32 bits on a 64 bit compiler. The explanation for INT_PTR can be found here[^]:
If you must cast a pointer to test some bits, set or clear bits, or otherwise manipulate its contents, use the UINT_PTR or INT_PTR type. These types are integral types that scale to the size of a pointer for both 32- and 64-bit Windows (for example, ULONG for 32-bit Windows and _int64 for 64-bit Windows).
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
IlanTal wrote:
What is an INT_PTR?
As Bob has pointed out, its just an integer, not a pointer to an integer. It's called INT_PTR because it is guaranteed to be the same size as a pointer, no matter what platform you're compiling for. In 32-bit Windows (with 32-bit pointers) it's a 32-bit integer. In 64-bit Windows (with 64-bit pointers) it's a 64-bit pointer.
Whenever you store a pointer as an integer, you should use the INT_PTR type so that your code is portable between 32-bit and 64-bit architectures.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I am doing some buffer manipulations .I have an array of chars having 0 value in between and i have to find the length of that buffer.i have buffer from -127 to +128 .so how can i find the exact length ?
I want to overload the strlen(const char *) function as this function will terminate when it will reach the null character , and returns upto that length of the char pointer.
|
|
|
|
|
It sounds like you've got a unicode string, so use the wcslen() function instead. It performs the same function is strlen() but on unicode strings.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I want to get a notification to my program, whenever some one copies a file to my folder, I tried ICopyHook, but I get alert only when someone copies a folder, but not on file.
http://www.priyank.in/
|
|
|
|
|
Please try ReadDirectoryChangesW .
|
|
|
|
|
vikrams wrote:
Please try ReadDirectoryChangesW .
I don't want my program to be always run in background and should be able to stop the copy operation, if I wish.
http://www.priyank.in/
|
|
|
|
|
Without running at least a service in the background this is not possible.
[EDIT]
And then there is always the possibility for the user to take the disk to another machine or use partition magic or ghost and copy at will...
[/EDIT]
John
|
|
|
|
|
Hello Sir,
Little clarification needed, What about ICopyHook , which detect Folder Operation, run as InProcess ATL DLL. i.e. no need of External EXE
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
But what if I use taskmanager to kill explorer and do the copy from the file the command line?
John
|
|
|
|
|
Hello Mr John,
I am not pulling you Leg,i just want to ask as there is ICopyHook for Folder,is there is anything similiar to FILES too
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
ICopyHOOK:
MSDN says
ICopyHook is a COM-based interface used to create a copy hook handler. A copy hook handler is a Shell extension that determines if a Shell folder or printer object can be moved, copied, renamed, or deleted. The Shell calls the ICopyHook::CopyCallback method prior to performing one of these operations.
No use for files.
|
|
|
|
|
|
|
Ya, but that is part of the shell, no separate executable is running only explorer.exe will do the job for that.
http://www.priyank.in/
|
|
|
|