I have executable one.exe which I want to launch executable two.exe and pass it pointers to variables so they can communicate via them.
one.exe is written in a language that is not capable of carrying out the tasks C++
is, which is what two.exe is developed in, and I want two.exe to communicate these variables to one.exe via memory.
I don't think I'll have a problem with the communication as I have done it before as I said, except that time the loosely types scripting language was capable of handling the passed args as pointers. So with them and also armed with the process id of the parent exe is quite capable of sharing the passed pointers and there values.
I am pretty sure I can also achieve the same now, but not unless I can pass two.exe a pid and a pointer.
On the same subject of command line, I would also like to get the name of the parent process that spawned it, which I'm not having much luck with either :(
>>Now the next part of my plan is a way to convert this char* representation of a pointer which will be passed in, to the actual numeric value of it.
Forget that idea, it won't, and can't work for reasons previously given. Pointers can not be passed between processes because each process has its own address space. Process A can not write into process B's address space, the operating system will prevent it by producing an Access Violation type of error.
So if I pass to a process I spawn, the pid of the parent process and a pointer to an address in it, I cannot get my
head around why I would not be able to read and write to that address. I have looked inside my noobness but I'm
really having a tough time moving on here.
you don't need vInt if all you are going to do is pass it to the Windows function. I don't know without testing if stringstream will work correctly like that, it may just return the char* instead of converting it to an integer.
Now that I think about it
unsinged int x;
ss << argv;
ss >> x;
iInt = (int*)x;