|
can't you click the [Reply] link on the guy's response you want to give feedback instead of replying to yourself ?!
|
|
|
|
|
I guess that would create some sort of thread hierarchy.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
|
Thank you Nibu. I got it. Can you please tell me its reason i mean why does windows not support process hirarchy.
Thank you again
We Believe in Excellence
|
|
|
|
|
Aqueel wrote: Can you please tell me its reason i mean why does windows not support process hirarchy
Deliberate design decision.
Why sould one have primary processes and processes of second, third... order?
In Unixoid systems this decision was made to allow some simulation of threads. Threads on Unix( Linux) are only now gaining momentum (NPTL).
In Windows, threads where there right from the start (of real, NT-type Windows, not graphical DOS-Extenders).
So there was simply no need for a logically not justified hierarchy among them.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Aqueel wrote: Can we create another process from the newly created child process?
Of course. CreateProcess() can be used as many times as needed. Process A can start process B, which can start process C, which can start process D, etc.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hello Mr. David,
I used CreateProcess to create a child process called processA. Now i want to create child process of processA. How can i do that?
Thank you.
We Believe in Excellence
|
|
|
|
|
Aqueel wrote: Now i want to create child process of processA. How can i do that
You have ProcessB call CreateProcess.
But these (then) three processes do not share a inherent hierarchical relationship.
They are independent processes of the system.
With inter-process-communication you can send messages about creation of another child-process to the creator so that you can maintain somthing like a graph.
But you have to do that yourself.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Simply call CreateProcess() within process A.
On a side note, I would lose this parent/child nomenclature. When a process is created via CreateProcess() , Windows treats them as two separate processes (i.e., same generation), even though one created the other. That's not to say that those two processes can no longer communicate with each other, but they are in no way related as far as the OS is concerned.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hello Community,
i have a Problem to use this Function in my Program,
<br />
pFile->QueryInfo(HTTP_QUERY_CONTENT_MD5, csAnswer, NULL);<br />
<br />
and here is my Problem, csAnswer is empty, but i know that pFile is not NULL!!!
Any idea for me how to use this QUERY????
thanx
break;
-- modified at 5:25 Wednesday 8th March, 2006
|
|
|
|
|
Hi i'm new to c++
and i'm trying to read from a file character by character and output the result on the console.
This is my code:::
#include <stdio.h>
#include<iostream.h>
int in_tags(FILE *pFile)
{
char t;
cout<<"in tags";
t=getc(pFile);
cout<<t;
while="" (t="getc(pFile)!='">')
{
cout<<t;
}
="" return="" 0;
}
int="" main="" ()
{
="" file="" *="" pfile;
="" char="" c;
="" bool="" tag;
="" pfile="fopen("example.txt","r");
" if="" (pfile="=NULL)" perror="" ("error="" opening="" file");
="" else
="" {
="" do="" c="getc" (pfile);
="" cout<<c;
="" if(c="='<')
" tag="in_tags(pFile);
" }="" while="" (c="" !="EOF);
" fclose=""
="" 0;
}
the="" output::
ok<in="" tagsi☺☺☺☺☺ok="" ok="" ok<in="" tagsi☺☺☺☺☺<in="" press="" any="" key
to="" continue
the="" file::
ok<inside="">ok ok ok<inside><inside>ok ok ok ok
The output that i get from the main program is ok
but when are coming from the function within the while loop
the caracters are lost and i get symbols.
I hope i'm clear enough but i don't think so but in case you know how to help me pls reply as this is for a project that i'm doing for college
thanks in advance!
|
|
|
|
|
Hello antonaras
Can you plz explain what is while (t=getc(pFile)!='>')
You should change your code like
while (getc(pFile) !='>')
Check it. It should work. I think due to wrong expression, you are going in an infinite loop.
Am i right?
Gool luck.
We Believe in Excellence
|
|
|
|
|
Aqueel thanks for the reply
i'll get more specific
what i'm trying to do is read an html code and clean the text from the tags(<>)
in function in_tags i want to process the html code to get understant things like color type font and so on.
in main i get the text if i get a character '<' i call function in_tags to process the tags part of the file. so i use while (t=getc(pFile)!='>') to terminate the function because the text is no longer in tags!
i try to outout on the console the text presented in tags in that while loop to make sure i'm in the right path but it seems that i'm not because in
while (t=getc(pFile)!='>')
cout<
|
|
|
|
|
Hey Aqueel i worked on what u said
u where right the problem is that i can't do this
while (t=getc(pFile)!='>')
i first need to get the character t=getc(pFile)
and than change the while loop to while(t!='>')
now is working thanks a lot u r the best cheers
|
|
|
|
|
antonaras_marcou wrote: the problem is that i can't do this
while (t=getc(pFile)!='>')
You can if you'd just add another pair of parenthesis:
while ((t = getc(pFile)) != '>') Breaking this statement into two separate statements is a better idea, however.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
you r right!!
i've spend hours trying to find what is wrong and that's it
2 more parenthesis!!
thanks for helping DavidCrow
|
|
|
|
|
antonaras_marcou wrote:
what i'm trying to do is read an html code and clean the text from the tags(<>)
Are you aware of Mr.Alok's product?
check^
VuNic
|
|
|
|
|
Thanks VuNic i've been looking for something like this for weeks now and i couldn't find anything helpfull enough.
This looks promising i hope i can understand the code and use it for my needs?
Thanks again appreciate
p.s If i have any problem using it i'll post a new message.
|
|
|
|
|
antonaras_marcou wrote: p.s If i have any problem using it i'll post a new message.
you are most welcome.
VuNic
|
|
|
|
|
he is assigning at the same time the variable t with the return of getc(pFile) . this is correct code.
don't confuse between operator = and operator == ...
|
|
|
|
|
Thanks for the reply v2.0
your saying that t=getc(pFile)is correct and it is the problem i had is when i include function getc in a while loop thats when the whole thing crashes.
Thangs again for the reply
|
|
|
|
|
Hello antonaras
I wanted to say that you can not do like that is loop. Actually you are not getting input again in while loop.
Please change your code with following after cout<<"in tags";
t=getc(pFile);<br />
while (t!='>')<br />
{<br />
cout<<t;<br />
t = getc(pFile);<br />
}
It should work. Dont hasitate to ask in case of any problem.
Good luck.
We Believe in Excellence
|
|
|
|
|
You can always rank helpful replies(on bottom right).
Regards
We Believe in Excellence
|
|
|
|
|
#include <iostream>
#inlcude <fstream>
#include <iterator>
#include <algorithm>
using namespace std;
int main ()
{
ifstream ifs("C:\\a.txt");
ifs >> noskipws; // We want white space.
copy(istream_iterator<char>(ifs), istream_iterator<char>(), ostream_iterator<char>(cout));
}
Steve
-- modified at 7:13 Wednesday 8th March, 2006
|
|
|
|
|
Hi,
I know virtual and heap memory use paged memory, but what is un-paged memory? Is it local and global variables?
Neil
-- modified at 4:22 Wednesday 8th March, 2006
|
|
|
|