|
This is an unusual scenario and, without knowing exactly what you’re up to, I feel safe saying it is probably a bad design decision. That said it is possible. When you use the CreateProcess API you can pass the DEBUG_PROCESS or DEBUG_ONLY_THIS_PROCESS flags (the second is probably what you’re after) in the ‘dwCreationFlags’ parameter. This flag is used by debuggers, as you probably guessed by the name, and results in exceptions thrown in the child process being reported to the parent. The information is passed to the parent process via the WaitForDebugEvent API. There is more to it that that obviously and, as I said, I don’t recommend using this technique. If you don't know exactly what you're doing you'll make a mess. Also throwing an exception becomes much more expensive for the child as it now results in a context switch to the parent and back to the child again. The child my also behave slight differently in some aspects; for example the ghost window[^] feature will not work in the process being debugged (the child). That said there are protection schemes, such as Armadillo, which use this technique and the software which uses it seems to work ok and when a developer is making an app it works in the debugger. Also note that as a process can only have one debugger attached to it you will probably not be able to use your debugger on it and even debuggers which can work under these conditions (such as WinDBG) will not be as powerful under this environment.
Steve
|
|
|
|
|
Steve, thank you for all that information. I wish to putforth a little more information that I need.
The child process handles most of the known exceptions, however, the parent process should handle the rest of the exceptions thats not handled by the child process itself. Exception handling by the parent process is a major part of the app that I need to develop.
|
|
|
|
|
When the child process ( sample.exe ) throws an exception, I am unable to get the Exception info thrown by the child process in the parent process's DEBUG_EVENT structure.
<br />
#include<stdio.h><br />
#include<windows.h><br />
<br />
STARTUPINFO startupInfo;<br />
PROCESS_INFORMATION processInformation;<br />
DWORD code;<br />
DEBUG_EVENT debug_event;<br />
BOOL val = 1;<br />
int main()<br />
{<br />
<br />
BOOL b = CreateProcess(NULL,"Sample.exe", NULL,NULL,FALSE,DEBUG_ONLY_THIS_PROCESS ,NULL,<br />
NULL,&startupInfo,&processInformation);<br />
val = WaitForDebugEvent(&debug_event, 2000);<br />
return 1;<br />
}<br />
Cheers
Pavan
|
|
|
|
|
Ftp connection provides feature of FindFile in a website.
is it possible to use http to find files in a website?
because Ftp requires user name and password, I don't have them, i.e, to google or MS site.
|
|
|
|
|
No.
The only thing you can do is something in the lines of wget. Download each page, parse it and get the next link.
This doesn't give you complete folder listings and may throw you to another http server also.
(usually, when someone asks if something can be done...i take a long time before saying no. In this case there's no doubt)
|
|
|
|
|
you say he reads links in each page,right?
whitesky
|
|
|
|
|
well yeah..if that's what he needs. If you have a better ideea, post it. Anyway, there's no way of listing files on a http server unless the server. If you're lucky, the server might print the contents of a folder into a html page but that still leaves you with a html page full of links.
|
|
|
|
|
of course i had like this problem and i used like this way
I think you have a better idea
whitesky
|
|
|
|
|
i want to use menu in dialog box..how can i use it.
thanx
|
|
|
|
|
1. Create a Menu Eg:IDR_MENU1
2. Open Dialog properties
3. Select IDR_MENU1 in Menu property.
|
|
|
|
|
hello
thanx..its working
can i handle menu similarly as i handle for the Doc/View Archicture.
thanx.
|
|
|
|
|
Yes
|
|
|
|
|
Go to Resources> Add A menu (SAY IDR_MYMENU)
Go to dialog editor. Right click for the property window.
In the property window select the menu you want to show
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
hello
thanx..its working
can i handle menu similarly as i handle for the Doc/View Archicture.
thanx.
|
|
|
|
|
Yeah In the OnCommand function of your dialog do this
switch(wParam)
{
case ID_FILE_HELLO:
AfxMessageBox("i am here");
break;
}
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
VC6 Dialog->Properties->General->Menu
set Meun ID in the Combox
ddddddddddddddddddddd
|
|
|
|
|
Create your program (for example CDialog)
then go to resource and right click in resource and use Add resource in this window use Menu and ok
now you can insert elements after insert item you can right click in each element and use
Add event handler... in the class list you can select your class and click Add and edit
then if it work you can see your function that depend to menu and write your code.
-----------
(2)
if you dont want to use resource you can create your menu (dymanic) that of course its not easy than to use above way
whitesky
|
|
|
|
|
Hi All,
I've got some problems with getting the
System Uptime.
I try to get the System Uptime of
NT4.0, WIN2000, WINXP, WIN2003.
By searching the Internet I've found
two solution's:
1. Using PDH-Counters (doesn't work under NT4.0)
2. Using getTickCount (but after 49.7days the Counter is reset to 0)
Thanks for your help.
Andy
|
|
|
|
|
Do you really need to support NT4?
Darka [Xanya]
-- modified at 4:40 Thursday 13th July, 2006
|
|
|
|
|
Yes, that's the problem!
I've only problems with the NT4.0 System.
If it's not possible to get the System Uptime
perhaps somebody could tell me how to get the
BootTime of this PC.
|
|
|
|
|
Metal_Knight wrote: ...how to get the
BootTime of this PC.
How about NetUserGetInfo() ?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Excluding NT4, can you use the SystemUpTime member of the Win32_PerfRawData_PerfOS_System class?
Have you seen this article?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Could you do it by scanning the event log for a boot message? Of course, if it's been up long enough, this message could expire off the event log buffer.
|
|
|
|
|
earl wrote: Could you do it by scanning the event log for a boot message?
Perhaps, but only Metal_Knight will know for sure if that's a viable option.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi..
I need to do a program in which i like to send data fron ethernet port and will catch in other systems hyperterminal...
Thanx in advance
birajendu
CyberG India
Delhi
India
|
|
|
|