|
Hello Farhat Aisha!
As per my knowledge,second parameter of SetPathName() function is responsible for maintaining MRU. The framework calls AddToRecentFileList()method when it opens a file or executes the Save As command to save a file with a new name. That inturn calls SetPathName. You can just override AddToRecentFileList() or SetPathName() !
-Malli...!
|
|
|
|
|
Thanks for your reply
Actually my problem is that I have a compound-document i.e, that contains a number of documents (This compound-document is not an MFC based class, it is my own class and it is a sort of collection of my individual documents)
And I have the provision to open a single document and also a compound-document.
When I open a compound document I set a flag and reset it immediately after the operation is complete
I have overridden the AddToRecentFileList() which does nothing when that flag is set otherwise it adds file names to MRU
My question is that is there any better way of doing it. I mean does MFC provide a better proviison for this
|
|
|
|
|
I think this is the only way to do ! And that too you did ! That's it !
-Malli...!
|
|
|
|
|
Hello Friends !
My VC program is launching an EXE (probably a VB Exe). How can I make VC program to wait till exe exits. I've tried with waitforsingleobject() using handle returned by ShellExecute(). That didn't work. So, I tried with Events, But VC program dosen't get notification of the event that I raise in that VB exe. Is there any other way to make my VC to wait to complete VB exe?
-Malli...!
|
|
|
|
|
A Demo[^]
Nibu thomas
Software Developer
|
|
|
|
|
Thanks Thomas !
It Worked ! I was under impression that CreateProcess()also behave like ShellExecute(), and would give same problem!
-Malli...!
|
|
|
|
|
Malli_S wrote: I've tried with waitforsingleobject() using handle returned by ShellExecute(). That didn't work.
You'll need to use ShellExecuteEx() instead.
"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
Does Windows support process hirarchy. That is we can create a process from parent process using CreateProcess(...). Can we create another process from the newly created child process? I have read somewhere that Windows does not support process hirarchy.
Here is a reference code from MSDN.
#include <windows.h><br />
#include <stdio.h><br />
<br />
void main( VOID )<br />
{<br />
TCHAR szCmdline[]=TEXT("MyChildProcess");<br />
STARTUPINFO si;<br />
PROCESS_INFORMATION pi;<br />
<br />
ZeroMemory( &si, sizeof(si) );<br />
si.cb = sizeof(si);<br />
ZeroMemory( &pi, sizeof(pi) );<br />
<br />
if( !CreateProcess( NULL,
szCmdline,
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&si,
&pi )
) <br />
{<br />
printf( "CreateProcess failed (%d).\n", GetLastError() );<br />
return;<br />
}<br />
<br />
WaitForSingleObject( pi.hProcess, INFINITE );<br />
<br />
CloseHandle( pi.hProcess );<br />
CloseHandle( pi.hThread );<br />
}
In above code, a child process has been created. I want to ask can we create nested child process using newly created process in above example.
Thank you.
We Believe in Excellence
|
|
|
|
|
Windows processes do not share a hierarchical relationship. The creating process receives the process handle and ID of the process it created so a hierarchical relationship can be maintained/simulated if the application requires it to do so. However, the operating system treats all processes as belonging to the same generation.
Processes in windows (by default) inherit the security settings of the creating process.
Nibu thomas
Software Developer
|
|
|
|
|
OK. In the example given in previous message, infomation about new process (lets say it ProcessA)has been stored in PROCESS_INFORMATION. How can i create a new process that is child process of ProcessA?
Thank You.
We Believe in Excellence
|
|
|
|
|
Aqueel wrote: OK. In the example given in previous message, infomation about new process (lets say it ProcessA)has been stored in PROCESS_INFORMATION. How can i create a new process that is child process of ProcessA?
No you cannot create a child process of another process. Of course you can maintain a process hierarchy in your application.
Nibu thomas
Software Developer
|
|
|
|
|
Thank you Nibu.
If i can not create that process then what is meant by maintainig hirarchy. Are you meant by single level hirarchy.
We Believe in Excellence
|
|
|
|
|
Aqueel wrote: If i can not create that process then what is meant by maintainig hirarchy. Are you meant by single level hirarchy.
No. As said in my first reply you can simulate a hierarchical behavior in your application. But it make no difference to the OS.
Nibu thomas
Software Developer
|
|
|
|
|
Sorry Nibu. It seems i am not getting it. As you said that we can simulate hirarical behavior. I want to ask that how can i do that?
Thank you.
We Believe in Excellence
|
|
|
|
|
Aqueel wrote: Sorry Nibu. It seems i am not getting it. As you said that we can simulate hirarical behavior. I want to ask that how can i do that?
Thank you.
Maintain a hierarchical structure of the processes that you create in your application. Now you have to decide which one is a parent process and which one is a child process.
Nibu thomas
Software Developer
|
|
|
|
|
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
|
|
|
|