|
You just as easily could have taken Google's second or third result and been much better off.
"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
|
|
|
|
|
VonHagNDaz wrote: [Insert Witty Sig Here]
waiting for something to insert [ ]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Besides all those Old-School C-Ways of converting,
there is the std::stringstream:
#include <strstream>
#include <iostream>
const double pi = 3.14;
std::string piString;
int main(int argc, char * argv[])
{
std::stringstream stream;
stream << pi;
stream >> piString;
std::cout << piString;
return system("pause");
}
Also, boost::lexical_cast[^] comes to mind.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
saravananmechanical wrote: char TempBuffer[50];
Why are you using an intermediary variable? Convert i directly into str .
"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
|
|
|
|
|
Hi
I am trying create a remote thread using ::CreateRemoteThread API. I am able to open the remote process (with PROCESS_ALL_ACCESS), and allocate the memory and write the function code successfully. But, when i try to create remote thread, the remote process is crashing. Pls give some points, where it may go wrong?
|
|
|
|
|
ramana.g wrote: Pls give some points, where it may go wrong?
I have no experience with that API, but here is something they hid in the documentation:
Note that CreateRemoteThread may succeed even if lpStartAddress points to data, code, or is not accessible. If the start address is invalid when the thread runs, an exception occurs, and the thread terminates. Thread termination due to a invalid start address is handled as an error exit for the thread's process.
|
|
|
|
|
In other words they do no checking whatsoever on the start address parameter. When the remote thread starts the infrastructure will use a CALL instruction to call the supplied start address, and if you're lucky the processor will generate a page fault hardware exception straight away. The OS will turn that into an access violation exception since there's no suitable page mapping, it'll go looking for an exception handler, not find one, and call the process's unhandled exception filter. Typically that will kill the process.
If unlucky your address will point to some data and it'll run for a while before it encounters a bit pattern not matching a valid instruction, or the data being interpreted as code tries to touch invalid memory, or it trashes some other pointer in the real program code which causes a crash.
It's very difficult to examine a pointer to determine whether it really points to valid code, simply because the range of valid instructions is so vast. A human might be able to spot that the sequence of instructions doesn't make sense and deduce that it's really data, but building in a complete heuristic engine to work that out is not worthwhile.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
Mike Dimmick wrote: and if you're lucky
Well if you don't apply the luck keyword properly what do you expect? Really I'm not sure what your point is. You expect to pass an invalid address as a function pointer and everything will work out just fine?
|
|
|
|
|
ramana.g wrote: the remote process is crashing
How? Where? You must provide details of the crash! We're no psychic!
Steve
|
|
|
|
|
Why 'CHotKeyCtrl' does not support ModWin key (it's one with Microsoft logo on it)???
What is the alternative?
Thanks!
|
|
|
|
|
i have made a small application which shows the files and folders in a particular designator. the files and folders are shown in a list box. and the designators are shown in a combo box.
i need to know how to copy a file from the list box to another location. if yes what needs to be done.
chandru080
|
|
|
|
|
I'm not certain what "designator" mean, but you can always use ShFileOperation with the FO_COPY flag set in the structure to copy files around.
There's an article on ShFileOperation here on CP.
|
|
|
|
|
Chandrasekharanp wrote: i need to know how to copy a file from the list box to another location.
The file isn't "in" the listbox. Just the name is in the listbox. What are "designators". If you want quicker help, you're going to have to start using common references.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
what i meant to say is the directories avialbale in the system are displayed in the combo box. (for ex C and D). now when i click on either one of them the folders and the files will appear on the directories. i need to know how to copy this files and folders to different loaction.
|
|
|
|
|
copyfile
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Chandrasekharanp wrote: ...a particular designator.
Qualify this a bit like, "a particular drive designator (e.g., C: )."
Chandrasekharanp wrote: i need to know how to copy a file from the list box to another location.
This is a bit ambiguous. Are you wanting to copy the file itself from one drive/folder to another, or are you wanting to copy an item from the listbox to some other control?
"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
|
|
|
|
|
guess i have specifially mentioned about copying files and folders to another location or rather as per question to another drive.
|
|
|
|
|
So can't you just use CopyFile() or SHFileOperation() ?
"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
|
|
|
|
|
Do you want to drag/drop files or copy files to other location?
|
|
|
|
|
is it possible to do it both the ways?? drag and drop as well as copying it??
|
|
|
|
|
Yeah it possible for example to Explorer or other controls on your program like listbox.
|
|
|
|
|
|
|
Alok give you a good link but if you are new to drag drop (I suggest before use for files see simple drags like drag a item of a list to other list) codeproject has articles about drag files.;)
|
|
|
|
|
Hamid. wrote: Yeah it possible for example to Explorer or other controls on your program like listbox.
yes.. but i havn't tried.. have you???
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|