|
Yes, that is almost exactly what i need to do, except not from within the process itself. I need to break into the application remotely using the OpenProcess/Thread functions and utilizing the debug libraries, and enumerate address space from there. Looks like i can just use VirtualQueryEx and enumerate that way. I'm gonna go give it a try, thanks for the insight.
~jason
|
|
|
|
|
how to compress/decompress image using lzw algorithm???
is there anyone know?
please send me a sample code , related links , some demo program ,
and many other that can help my project
thanks a lot...
|
|
|
|
|
dev_buzz wrote: how to compress/decompress image using lzw algorithm???
For such a broad question as that, all I can suggest is to use an LZW library.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
|
I have a situation--
CString str = "37.62";
double d, d1;
d = atof(str);
d1 = strtod(str, NULL);
The results of both d and d1 are 37.619999999999997 (unexpected)
what do i do to get d=37.62 and d1=37.62
|
|
|
|
|
Member 3611002 wrote: what do i do...
Read here.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Looks like it will take weeks to get through that doc [ ] Can you please explain in simple words what is the cause and resolution of this behavior if I may request so ?
|
|
|
|
|
cagespear wrote: Looks like it will take weeks to get through that doc
So just search for another one. They're plentiful. Here for example.
cagespear wrote: Can you please explain in simple words what is the cause...
Computers are binary (i.e., base-2) machines, thus they cannot exactly represent floating-point numbers as you might think.
cagespear wrote: ...and resolution of this behavior if I may request so ?
Epsilon.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
There are two problems with real numbers on computers.
1. Not every real number have an exact binary representation. For example 0.1 when represented in binary is 0.0001100110011001100110011001100110011001100110011001101 now when you convert it back to real number you will get 0.10000000000000001. Note you can try this calculation by hand and this inaccuracy has got nothing to do with how we represent real numbers in computer.
2. There are uncountably infinite real numbers but computers can only represent and manipulate finite numbers (Well at least in hardware). This means that not every real number can be expressed in computer.
Hope this makes it clear.
-Saurabh
|
|
|
|
|
Simply, this is related with binary representation of floating point numbers.
Member 3611002 wrote: The results of both d and d1 are 37.619999999999997 (unexpected)
what do i do to get d=37.62 and d1=37.62
This is normal and there is nothing to do for a double type. if you format that number back using format string %.2f, you will get 37.62 again.
I'll try to comment on, shortly.
As you may know, double is a 64 bit floating point number. There are some special formats (standards defined by IEEE in this case) to store it in memory. It consists of 3 parts; sign (1), exponent (11), significand (52 bits). There are also special rules for storing exponent and significand. Most important one, exponent part is two's exponent, not ten's. Moreover, some operations (i.e. rounding and normalization) have been applied to a floating point number after every operation. After all, it is stored as nearest possible value fitting into these rules.
|
|
|
|
|
This is what I am doin...
string filename; //filename contains "c:\\new folder\\file1.txt"
....
....
ofstream myfile;
myfile.open (filename, ios::app);
When I compile or built this I get
error C2664: 'void __thiscall std::basic_ofstream<char,struct std::char_traits<char=""> >::open(const char *,int)' : cannot convert parameter 1 from 'class std::basic_string<char,struct std::char_tr<br="" mode="hold">aits<char>,class std::allocator<char> >' to 'const char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Error executing cl.exe.
Please help me get rid of this or any suggestion to make changes to this. THANKS
|
|
|
|
|
pl_kode wrote: myfile.open (filename, ios::app);
Change to
myfile.open (filename.c_str(), ios::app);
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
|
It does not show any error like this..
Nor does its creating any file in the specified path.
Wt shud I do.
|
|
|
|
|
pl_kode wrote: filename contains "c:\\new folder\\file1.txt"
did you created the "new folder" directory in "C:\" drive, you should not expect open API will do that.
|
|
|
|
|
for istance, you may call myfile.rdstate() .
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I tried it by using rdstate(). Still stuck with the same thing.
|
|
|
|
|
pl_kode wrote: I tried it by using rdstate()
What is the return value?
Have you read the Rajkumar reply?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
pl_kode wrote: myfile.open (filename, ios::app);
does replacing it with something like : myfile.open (filename.c_str(), ios::app); works ?
|
|
|
|
|
It doesn't show any errors like this. But it also do not create a file in the folder.
|
|
|
|
|
Can you try creating a file manually there ? Do you have the write access to the path?
|
|
|
|
|
Yes if i give ..
ofstream myfile;
myfile.open ("c:\\New folder\\file1.txt", ios::app);
It works. Even a file is created.
But I want it the other way.
|
|
|
|
|
can you post how you initialise filename variable. or check the value of filename before open(),
cout << filename.c_str();
|
|
|
|