|
can u kindly explain more what the meaning by ur code ??
you just sub. two addr of two pointer of two function !! how this be the size and size of which one ..
i really misunderstand
thx
|
|
|
|
|
Assuming the two functions are back-to-back in memory, you can simply take the difference of their addresses to obtain the size. In other words, if functionA() is at 0x1234 and functionB() is at 0x2345, then the size of functionA() would be 4,369 bytes.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Nicely said.
This is precisely what is happening.
Once more, don't do this.
|
|
|
|
|
Member 754960 wrote: Once more, don't do this.
I wouldn't. I was just explaining to Adore what was happening.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
ooh sure should not be used !!
nothing can guaranty that the two functions are above each other in the memory !!!
see no way here ..
indeed its a client request for what i don't know !
thx all
|
|
|
|
|
Since that won't do, try this:
Load the program in a debugger and read the starting and ending address of the function and do the math.
Otherwise you need to do a lot more research before you can ask your question.
|
|
|
|
|
I am adapting for Visual C++ 2008 a Borland C++ 4.5 program which includes this function:
int is_dir(char*path){struct stat i; stat(path,&i); return i.st_mode&S_IFDIR;}
which returns non-zero if path is the name of a directory. But Visual C++ does not know the type struct stat. Please how could I do this in Visual C++ (preferably without using classes)?
|
|
|
|
|
|
That help page describes a function PathIsDirectory() ; howeer, the result was
\2d\ppp_vc\ppp_vc\mwproc.cpp(396) : error C3861: 'PathIsDirectory': identifier not found
|
|
|
|
|
Look at the bottom of the doc page. It will list the header and lib file needed to use the function.
Judy
|
|
|
|
|
Did you include header file?
|
|
|
|
|
As stated in the documentation, you have to include shlwapi.h header file and link with shlwapi.lib library.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Why you didn't write it needs to the header file?
|
|
|
|
|
OMG, I also forgot to tell him he needs a compiler (perhaps a computer too)!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
I saw your answers they are nice;) .
|
|
|
|
|
Thank you very much.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Hello world!
How to detect if a windows named pipe is FULL
I use a overlapped structure and the GetOverlappedResult function (for asynchronous I/O).
When my named pipe is full I want to wait free space to continue writing data (like a FIFO).
But I don't know how to detect if my pipe is full?
Thanks for any help, advices, etc...
Hello World!!!
from Raphaël
|
|
|
|
|
You can't.
One of the ideas of overlapped I/O is so that you don't
have to wait. Overlapped I/O is also FIFO already.
If you want to wait, don't use overlapped I/O.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks for your reply...
My problem is that I've a first process that writes data (raw image) to a pipe and a second process which connects to this pipe and reads data from the pipe.
I want to use overlapped structure to let the first process write the next data without waiting until the second process read the old data.
It's important for the first process to know when the pipe is full because at this time It can skip images.
If you have any suggestions to do that...
Thanks in advance.
Hello World!!!
from Raphaël
|
|
|
|
|
Throttling data stream rate can be complex. You could establish a
constant rate or use an adjustable/variable rate based on comm
conditions, which are continuously monitored.
You'll maybe want to somehow keep track of how many overlapped operations
are pending. If this value keeps increasing, then you need to slow
the send rate until the amount of pending ops stays constant.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
I'm going to learn a new subject on C++. Working with Windows API. Since I work with Java there is no API used, but I feel it is better to work a little with APIs.
Here is my attempt for that.
I want to read the system time zones and display on the console. Basically in two columns, City and the Time offset. From where I should start work. Can you guys give some clues. Following week I'm free because of Christmas, so I can do some work on it.
Thanks
I appreciate your help all the time...
Eranga
|
|
|
|
|
Can you use of GetSystemTime?
|
|
|
|
|
Actually I'm looking to get the timezone details from the system. I mean if you check the time zone drop-down menu you can see a large number of timezones list. What I want to do is read all of them and print on a console.
I appreciate your help all the time...
Eranga
|
|
|
|
|
A time zone is simply the number of hours a particular area is from UTC. So you could get fairly close with something like:
for (int x = -12; x < 15; x++)
{
if (x < 0)
printf("UTC%d\n", x);
else if (x > 0)
printf("UTC+%d\n", x);
else
printf("UTC\n");
} You can add this to a list of some sort, along with some familiar city located within each zone.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for your code.
I think there is one thing, which I can't do. The list of time zone names. Only I can get the systems' time zone informations. Is that right. When I go through the MSDN, that what I got.
I appreciate your help all the time...
Eranga
|
|
|
|