|
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/
|
|
|
|
|
There is one other thing even if this worked for files. It would not stop or detect someone from writing a 15 line program that read the file and saved it to disk.
John
|
|
|
|
|
John M. Drescher wrote:
not stop or detect someone from writing a 15 line program
Who said this software is for CP members, its just for my client
http://www.priyank.in/
|
|
|
|
|
Priyank Bolia wrote:
its just for my client
My guess is the file contains some type of code that will unlock the features of your program for one pc and you don't want him/her to copy the file to other computers violating the license. If this is so you could hide this in a hidden file in some folder that it not expected (several levels from the root) or better yet hide it in the registry as the average user would not find it there unless you name you name it something obvious...
John
|
|
|
|
|
John M. Drescher wrote:
My guess
Times Out......
You guess wrong, the problem is the original one only, I software "FileSecure" that makes a folder safe, you can read, edit, delete, copy, etc. on that folder on any Win platform and file system and also it should work in safe work.
http://www.priyank.in/
|
|
|
|